/** * Factory to create the identity predicate. * * @param type the type to check for, may not be null * @return the predicate * @throws NullPointerException if the class is null */ public static Predicate<Object> instanceOfPredicate(final Class<?> type) { if (type == null) { throw new NullPointerException("The type to check instanceof must not be null"); } return new InstanceofPredicate(type); }
/** * Creates a Predicate that checks if the object passed in is of * a particular type, using instanceof. A <code>null</code> input * object will return <code>false</code>. * * @param type the type to check for, may not be null * @return the predicate * @throws NullPointerException if the class is null * @see InstanceofPredicate */ public static Predicate<Object> instanceofPredicate(final Class<?> type) { return InstanceofPredicate.instanceOfPredicate(type); }
PredicatedCollection.predicatedCollection( new AdaptedCollection<PositionedRenderable,Positionable>(getVisibleWorldObjectList(),Util.bidi2Backward(castingAdapter),Util.bidi2Forward(castingAdapter)), new InstanceofPredicate(PositionedRenderable.class)); setCamera(camera); assert camera!=null;