Example usage for java.lang.reflect AccessibleObject equals

List of usage examples for java.lang.reflect AccessibleObject equals

Introduction

In this page you can find the example usage for java.lang.reflect AccessibleObject equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Indicates whether some other object is "equal to" this one.

Usage

From source file:com.yahoo.elide.core.EntityBinding.java

/**
 * Bind an id field to an entity./*from  ww  w . j  a  v  a 2 s .  com*/
 *
 * @param cls Class type to bind fields
 * @param type JSON API type identifier
 * @param fieldOrMethod Field or method to bind
 */
private void bindEntityId(Class<?> cls, String type, AccessibleObject fieldOrMethod) {
    String fieldName = getFieldName(fieldOrMethod);
    Class<?> fieldType = getFieldType(fieldOrMethod);

    //Add id field to type map for the entity
    fieldsToTypes.put(fieldName, fieldType);

    //Set id field, type, and name
    idField = fieldOrMethod;
    idType = fieldType;
    idFieldName = fieldName;

    if (idField != null && !fieldOrMethod.equals(idField)) {
        throw new DuplicateMappingException(type + " " + cls.getName() + ":" + fieldName);
    }
}