/** * @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; }
/** * Convenience method to create a comparator which orders storables by the * given properties. * * @param properties list of properties to order by * @throws IllegalArgumentException if no properties or if any property is null */ public static <S extends Storable> Comparator<S> createComparator(List<OrderedProperty<S>> properties) { if (properties == null || properties.size() == 0 || properties.get(0) == null) { throw new IllegalArgumentException(); } Class<S> type = properties.get(0).getChainedProperty().getPrimeProperty().getEnclosingType(); BeanComparator bc = BeanComparator.forClass(type); for (OrderedProperty<S> property : properties) { if (property == null) { throw new IllegalArgumentException(); } bc = orderBy(bc, property); } return bc; }
/** * Convenience method to create a comparator which orders storables by the * given properties. * * @param properties list of properties to order by * @throws IllegalArgumentException if no properties or if any property is null */ public static <S extends Storable> Comparator<S> createComparator(List<OrderedProperty<S>> properties) { if (properties == null || properties.size() == 0 || properties.get(0) == null) { throw new IllegalArgumentException(); } Class<S> type = properties.get(0).getChainedProperty().getPrimeProperty().getEnclosingType(); BeanComparator bc = BeanComparator.forClass(type); for (OrderedProperty<S> property : properties) { if (property == null) { throw new IllegalArgumentException(); } bc = orderBy(bc, property); } return bc; }
BeanComparator bc = BeanComparator.forClass(type);
/** * Convenience method to create a comparator which orders storables by the * given properties. * * @param properties list of properties to order by * @throws IllegalArgumentException if no properties or if any property is null */ public static <S extends Storable> Comparator<S> createComparator(OrderedProperty<S>... properties) { if (properties == null || properties.length == 0 || properties[0] == null) { throw new IllegalArgumentException(); } Class<S> type = properties[0].getChainedProperty().getPrimeProperty().getEnclosingType(); BeanComparator bc = BeanComparator.forClass(type); for (OrderedProperty<S> property : properties) { if (property == null) { throw new IllegalArgumentException(); } bc = orderBy(bc, property); } return bc; }
/** * Convenience method to create a comparator which orders storables by the * given properties. * * @param properties list of properties to order by * @throws IllegalArgumentException if no properties or if any property is null */ public static <S extends Storable> Comparator<S> createComparator(OrderedProperty<S>... properties) { if (properties == null || properties.length == 0 || properties[0] == null) { throw new IllegalArgumentException(); } Class<S> type = properties[0].getChainedProperty().getPrimeProperty().getEnclosingType(); BeanComparator bc = BeanComparator.forClass(type); for (OrderedProperty<S> property : properties) { if (property == null) { throw new IllegalArgumentException(); } bc = orderBy(bc, property); } return bc; }
BeanComparator bc = BeanComparator.forClass(type);
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"));
BeanComparator.forClass(StorableProperty.class).orderBy("name"));
BeanComparator.forClass(StorableProperty.class).orderBy("name"));