本文整理匯總了Java中org.biokoframework.system.entity.EntityNotFoundException類的典型用法代碼示例。如果您正苦於以下問題:Java EntityNotFoundException類的具體用法?Java EntityNotFoundException怎麽用?Java EntityNotFoundException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
EntityNotFoundException類屬於org.biokoframework.system.entity包,在下文中一共展示了EntityNotFoundException類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createEntityNotFound
import org.biokoframework.system.entity.EntityNotFoundException; //導入依賴的package包/類
public static CommandException createEntityNotFound(Class<? extends DomainEntity> entityClass, String entityId) {
String[] message = sErrorMap.get(FieldNames.ENTITY_WITH_ID_NOT_FOUND_CODE);
Fields fields = new Fields(
ErrorEntity.ERROR_CODE, FieldNames.ENTITY_WITH_ID_NOT_FOUND_CODE,
ErrorEntity.ERROR_MESSAGE, new StringBuilder()
.append(message[0])
.append(entityClass.getSimpleName())
.append(message[1])
.append(entityId)
.append(message[2])
.toString());
ErrorEntity entity = new ErrorEntity();
entity.setAll(fields);
return new EntityNotFoundException(entity);
}
示例2: create
import org.biokoframework.system.entity.EntityNotFoundException; //導入依賴的package包/類
public static HashMap<Class<? extends BiokoException>, HttpError> create() {
HashMap<Class<? extends BiokoException>, HttpError> exceptionMap = new HashMap<Class<? extends BiokoException>, HttpError>();
exceptionMap.put(BadCommandInvocationException.class, new HttpError(400));
exceptionMap.put(AuthenticationFailureException.class, new HttpError(401));
exceptionMap.put(EntityNotFoundException.class, new HttpError(404));
exceptionMap.put(CommandNotFoundException.class, new HttpError(404));
exceptionMap.put(ValidationException.class, new HttpError(400));
exceptionMap.put(CommandException.class, new HttpError(500));
exceptionMap.put(EasterEggException.class, new HttpError(418));
return exceptionMap;
}
示例3: repositoryEmpty
import org.biokoframework.system.entity.EntityNotFoundException; //導入依賴的package包/類
public static CommandException repositoryEmpty(String entityName) {
String[] message = sErrorMap.get(FieldNames.REPOSITORY_IS_EMPTY_CODE);
Fields fields = new Fields(
ErrorEntity.ERROR_CODE, FieldNames.REPOSITORY_IS_EMPTY_CODE,
ErrorEntity.ERROR_MESSAGE, new StringBuilder()
.append(message[0])
.append(entityName)
.append(message[1])
.toString());
ErrorEntity entity = new ErrorEntity();
entity.setAll(fields);
return new EntityNotFoundException(entity);
}
示例4: createMap
import org.biokoframework.system.entity.EntityNotFoundException; //導入依賴的package包/類
protected Map<Class<? extends BiokoException>, ? extends Integer> createMap() {
HashMap<Class<? extends BiokoException>, Integer> map = new HashMap<>();
map.put(BadCommandInvocationException.class, 400);
map.put(AuthenticationFailureException.class, 401);
map.put(EntityNotFoundException.class, 404);
map.put(CommandNotFoundException.class, 404);
map.put(UnknownRouteException.class, 404);
map.put(ForbiddenAccessException.class, 403);
map.put(ValidationException.class, 400);
map.put(CommandException.class, 500);
map.put(EasterEggException.class, 418);
return map;
}