public int hashCode() { if (!mHasHashCode) { setHashCode(new Rules(this)); } return mHashCode; }
IndexedProperty(BeanProperty property) { super(property.getName(), property.getType(), property.getCovariantTypes()); setReadMethod(property.getReadMethod()); setWriteMethod(property.getWriteMethod()); }
/** * @param sort when true, sort annotation members by name (case sensitive) */ public AnnotationVisitor(boolean sort) { if (sort) { mMethodComparator = BeanComparator .forClass(Method.class).orderBy("name").caseSensitive(); } else { mMethodComparator = null; } }
public Object visit(String name, int pos, int[] value, Object param) { appendName(name, pos, TAG_ARRAY); super.visit(name, pos, value, param); mBuilder.append(';'); return null; }
IndexedProperty addCovariantType(Class type) { SimpleProperty property = super.addCovariantType(type); if (property == null) { return null; } IndexedProperty ix = new IndexedProperty(property); ix.mIndexedReadMethods = mIndexedReadMethods; ix.mIndexedWriteMethods = mIndexedWriteMethods; return ix; }
@Override public Object put(String key, Object value) { Object old = mAccessor.tryGetPropertyValue(mBean, key); mAccessor.setPropertyValue(mBean, key, value); return old; }
private Map<String, BeanProperty> getProperties() { if (mProperties == null) { mProperties = BeanIntrospector.getAllProperties(mBeanClass); } return mProperties; }
/** * Create a ClassInjector for defining one class. The parent ClassLoader * used is the one which loaded the ClassInjector class. */ public static ClassInjector create() { return create(null, null); }
/** * Prints the annotation to the builder passed to the constructor. * * @param value Annotation to visit * @return null */ public Object visit(Annotation value) { return visit(value, null); }
/** * Toggle reverse-order option on just the last {@link #orderBy order-by} * property. By default, order is ascending. If no order-by properties have * been specified, then reverse order is applied to the compared beans. */ public BeanComparator<T> reverse() { BeanComparator<T> bc = new BeanComparator<T>(this); bc.mOrderByName = mOrderByName; bc.mUsingComparator = mUsingComparator; bc.mFlags = mFlags ^ 0x01; return bc; }
public int size() { // Cleanup right before, to report a more accurate size. cleanup(); return this.count; }
/** * Gets the map as a String. * * @return a string version of the map */ public String toString() { return toString(this); }
static int hashCode(Object[] a) { int hash = 0; for (int i = a.length; --i >= 0; ) { hash = hash * 31 + hashCode(a[i]); } return hash == 0 ? -1 : hash; }
public boolean equals(Object obj) { if (!(obj instanceof Map.Entry)) { return false; } return equals((Map.Entry)obj); }
Entry(int hash, K key, V value, Entry<K, V> next) { this.hash = hash; this.key = key; this.value = newReference(value); this.next = next; }
/** * Visits an annotation by breaking it down into its components and calling * various other visit methods. * * @param value Initial Annotation to visit * @param param custom parameter * @return custom result, null by default */ public final R visit(Annotation value, P param) { return visit(null, 0, value, param); }
private char peekTag() { char tag = parseTag(); mPos--; return tag; }
public Object visit(String name, int pos, char[] value, Object param) { appendName(name, pos, TAG_ARRAY); super.visit(name, pos, value, param); mBuilder.append(';'); return null; }