List of usage examples for java.lang Class equals
public boolean equals(Object obj)
From source file:org.openmrs.web.controller.ConceptFormValidator.java
/** * Determines if the command object being submitted is a valid type * * @see org.springframework.validation.Validator#supports(java.lang.Class) *///ww w . j a va 2s.c o m @SuppressWarnings("rawtypes") public boolean supports(Class c) { return c.equals(ConceptFormBackingObject.class); }
From source file:org.n52.oss.ui.services.OSSAuthenticationProvider.java
@Override public boolean supports(Class<?> arg0) { return arg0.equals(UsernamePasswordAuthenticationToken.class); }
From source file:com.useekm.types.GeometryMarshall.java
public GeometryMarshall(Class<T> clazz, ValueFactory vf) { if (clazz.equals(GeoWkt.class)) this.datatype = GeoConstants.XMLSCHEMA_SPATIAL_TEXT; else if (clazz.equals(GeoWkb.class)) this.datatype = GeoConstants.XMLSCHEMA_SPATIAL_BIN; else if (clazz.equals(GeoWktGz.class)) this.datatype = GeoConstants.XMLSCHEMA_SPATIAL_TEXTGZ; else {// ww w.j a v a 2 s .co m Validate.isTrue(clazz.equals(GeoWkbGz.class)); this.datatype = GeoConstants.XMLSCHEMA_SPATIAL_BINGZ; } this.vf = vf; try { this.constructor = clazz.getConstructor(String.class); } catch (NoSuchMethodException e) { throw new IllegalStateException(e); } }
From source file:com.seajas.search.profiler.validator.ArchiveValidator.java
/** * Determine whether this validator supports the command object. * //from ww w . j a va2 s. c o m * @param klass * @return boolean */ @Override public boolean supports(final Class<?> klass) { return klass.equals(ArchiveCommand.class); }
From source file:com.viadee.acceptancetests.roo.addon.StoryGroupConverter.java
public boolean supports(Class<?> requiredType, String optionContext) { return requiredType.equals(StoryGroup.class); }
From source file:net.jofm.format.NumberFormat.java
private Object convert(Number result, Class<?> destinationClazz) { if (destinationClazz.equals(BigDecimal.class)) { return new BigDecimal(result.doubleValue()); }/*from w w w . ja va 2s.co m*/ if (destinationClazz.equals(Short.class) || destinationClazz.equals(short.class)) { return new Short(result.shortValue()); } if (destinationClazz.equals(Integer.class) || destinationClazz.equals(int.class)) { return new Integer(result.intValue()); } if (destinationClazz.equals(Long.class) || destinationClazz.equals(long.class)) { return new Long(result.longValue()); } if (destinationClazz.equals(Float.class) || destinationClazz.equals(float.class)) { return new Float(result.floatValue()); } if (destinationClazz.equals(Double.class) || destinationClazz.equals(double.class)) { return new Double(result.doubleValue()); } throw new FixedMappingException("Unable to parse the data to type " + destinationClazz.getName() + " using " + this.getClass().getName()); }
From source file:com.androidquery.simplefeed.callback.PTransformer.java
@Override public <T> T transform(String url, Class<T> type, String encoding, byte[] data, AjaxStatus status) { if (type.equals(Feed.class)) { Feed result = null;/*from ww w .j a va 2s . c o m*/ try { String str = new String(data, encoding); JSONObject jo = (JSONObject) new JSONTokener(str).nextValue(); result = new Feed(jo); } catch (Exception e) { AQUtility.debug(e); } return (T) result; } return null; }
From source file:com.yahoo.elide.graphql.NonEntityDictionary.java
/** * Add given class to dictionary.//from w ww. ja v a 2 s.c o m * * @param cls Entity bean class */ @Override public void bindEntity(Class<?> cls) { String type = WordUtils.uncapitalize(cls.getSimpleName()); Class<?> duplicate = bindJsonApiToEntity.put(type, cls); if (duplicate != null && !duplicate.equals(cls)) { log.error("Duplicate binding {} for {}, {}", type, cls, duplicate); throw new DuplicateMappingException(type + " " + cls.getName() + ":" + duplicate.getName()); } entityBindings.put(cls, new EntityBinding(this, cls, type, type)); }
From source file:m2.android.archetype.example.aquery.fb.base.PTransformer.java
@Override public <T> T transform(String url, Class<T> type, String encoding, byte[] data, AjaxStatus status) { if (type.equals(BaseObj.class)) { BaseObj result = null;/*from ww w.j a va 2 s . co m*/ try { String str = new String(data, encoding); JSONObject jo = (JSONObject) new JSONTokener(str).nextValue(); result = BaseObj.parse(jo.getString("data")); } catch (Exception e) { AQUtility.debug(e); } return (T) result; } return null; }
From source file:org.jsonschema2pojo.integration.config.CustomRuleFactoryIT.java
@Test public void customAnnotatorIsAbleToAddCustomAnnotations() throws ClassNotFoundException, SecurityException, NoSuchMethodException { ClassLoader resultsClassLoader = schemaRule.generateAndCompile("/schema/format/formattedProperties.json", "com.example", config("customRuleFactory", TestRuleFactory.class.getName())); Class<?> generatedType = resultsClassLoader.loadClass("com.example.FormattedProperties"); Method getter = generatedType.getMethod("getStringAsDate"); Class<?> returnType = getter.getReturnType(); assertThat(returnType.equals(LocalDate.class), is(true)); }