use of nikita.common.model.noark5.v4.metadata.PostalCode in project nikita-noark5-core by HiOA-ABI.
the class PostalCodeService method findByDescription.
/**
* Retrieve all PostalCode that have a given description.
* <br>
* Note, this will be replaced by OData search.
*
* @param description Description of object you wish to retrieve. The
* whole text, this is an exact search.
* @return A list of PostalCode objects wrapped as a MetadataHateoas
* object
*/
@Override
public MetadataHateoas findByDescription(String description) {
MetadataHateoas metadataHateoas = new MetadataHateoas((List<INikitaEntity>) (List) postalCodeRepository.findByDescription(description), POST_CODE);
metadataHateoasHandler.addLinks(metadataHateoas, new Authorisation());
return metadataHateoas;
}
use of nikita.common.model.noark5.v4.metadata.PostalCode in project nikita-noark5-core by HiOA-ABI.
the class PostalCodeService method findAll.
// All READ operations
/**
* Retrieve a list of all PostalCode objects
*
* @return list of PostalCode objects wrapped as a
* MetadataHateoas object
*/
@Override
public MetadataHateoas findAll() {
MetadataHateoas metadataHateoas = new MetadataHateoas((List<INikitaEntity>) (List) postalCodeRepository.findAll(), POST_CODE);
metadataHateoasHandler.addLinks(metadataHateoas, new Authorisation());
return metadataHateoas;
}
use of nikita.common.model.noark5.v4.metadata.PostalCode in project nikita-noark5-core by HiOA-ABI.
the class PostalCodeService method generateDefaultPostalCode.
/**
* Generate a default PostalCode object
*
* @return the PostalCode object wrapped as a PostalCodeHateoas object
*/
@Override
public PostalCode generateDefaultPostalCode() {
PostalCode postalCode = new PostalCode();
postalCode.setCode(TEMPLATE_POST_CODE_CODE);
postalCode.setDescription(TEMPLATE_POST_CODE_DESCRIPTION);
return postalCode;
}
use of nikita.common.model.noark5.v4.metadata.PostalCode in project nikita-noark5-core by HiOA-ABI.
the class PostalCodeService method findByCode.
/**
* retrieve all PostalCode that have a particular code.
* <br>
* Note, this will be replaced by OData search.
*
* @param code The code of the object you wish to retrieve
* @return A list of PostalCode objects wrapped as a MetadataHateoas
* object
*/
@Override
public MetadataHateoas findByCode(String code) {
MetadataHateoas metadataHateoas = new MetadataHateoas((List<INikitaEntity>) (List) postalCodeRepository.findByCode(code), POST_CODE);
metadataHateoasHandler.addLinks(metadataHateoas, new Authorisation());
return metadataHateoas;
}
use of nikita.common.model.noark5.v4.metadata.PostalCode in project nikita-noark5-core by HiOA-ABI.
the class PostalCodeService method find.
// find by systemId
/**
* Retrieve a single PostalCode object identified by systemId
*
* @param systemId systemId of the PostalCode you wish to retrieve
* @return single PostalCode object wrapped as a MetadataHateoas object
*/
@Override
public MetadataHateoas find(String systemId) {
MetadataHateoas metadataHateoas = new MetadataHateoas(postalCodeRepository.findBySystemId(systemId));
metadataHateoasHandler.addLinks(metadataHateoas, new Authorisation());
return metadataHateoas;
}
Aggregations