/** * @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; } }
BeanComparator<?> subOrder = forClass(prop.getType()); subOrder.mCollator = mCollator; bc = bc.using(subOrder.orderBy(subName));
/** * @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; } }
/** * @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; } }
/** * @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; } }
private StorableProperty<S>[] ensureAllProperties(StorableProperty<S>[] properties) { if (properties == null) { properties = gatherAllProperties(); } else { for (Object prop : properties) { if (prop == null) { throw new IllegalArgumentException(); } } // Sort to generate more efficient code. properties = properties.clone(); Arrays.sort(properties, BeanComparator.forClass(StorableProperty.class).orderBy("number")); } return properties; }
private StorableProperty<S>[] ensureAllProperties(StorableProperty<S>[] properties) { if (properties == null) { properties = gatherAllProperties(); } else { for (Object prop : properties) { if (prop == null) { throw new IllegalArgumentException(); } } // Sort to generate more efficient code. properties = properties.clone(); Arrays.sort(properties, BeanComparator.forClass(StorableProperty.class).orderBy("number")); } return properties; }
BeanComparator<?> subOrder = forClass(prop.getType()); subOrder.mCollator = mCollator; bc = bc.using(subOrder.orderBy(subName));
BeanComparator.forClass(StorableProperty.class).orderBy("name"));
BeanComparator.forClass(StorableProperty.class).orderBy("name"));
private static BeanComparator orderBy(BeanComparator bc, String property, Class type, Direction direction) { bc = bc.orderBy(property); if (type != null && type.isArray()) { TypeDesc td = TypeDesc.forClass(type); if (td.getRootComponentType() == TypeDesc.BYTE) { bc = bc.using(Comparators.arrayComparator(type, true)); } else { Comparator c = Comparators.arrayComparator(type, false); if (c == null) { throw new IllegalArgumentException("Cannot sort by property type of " + type.getName() + " for " + property); } bc = bc.using(c); } } else { bc = bc.caseSensitive(); } if (direction == Direction.DESCENDING) { bc = bc.reverse(); } return bc; }
BeanComparator.forClass(StorableProperty.class).orderBy("name"));
private static BeanComparator orderBy(BeanComparator bc, String property, Class type, Direction direction) { bc = bc.orderBy(property); if (type != null && type.isArray()) { TypeDesc td = TypeDesc.forClass(type); if (td.getRootComponentType() == TypeDesc.BYTE) { bc = bc.using(Comparators.arrayComparator(type, true)); } else { Comparator c = Comparators.arrayComparator(type, false); if (c == null) { throw new IllegalArgumentException("Cannot sort by property type of " + type.getName() + " for " + property); } bc = bc.using(c); } } else { bc = bc.caseSensitive(); } if (direction == Direction.DESCENDING) { bc = bc.reverse(); } return bc; }
BeanComparator.forClass(StorableProperty.class).orderBy("name"));