@Override public MApiResponse build() { if(name == null && status == null) { throw new IllegalStateException("'name' or 'status' must not be specified!"); } if(null == name) { name = String.valueOf(status); } if(typeClass != null && type == null){ if(typeManager == null){ throw new IllegalStateException("'typeManager' must not be specified!"); } type = typeManager.getMType(typeClass); } MApiHeader[] headerArray = Builders.buildArray(headers, new MApiHeader[headers.size()]); return new MApiResponse(name, summary, description, status, type, file, headerArray, attrs); }