本文整理汇总了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;
}