Package de.javagl.ply

Class ObjectPlyTarget.Handle<T>

  • Type Parameters:
    T - The element type
    Enclosing class:
    ObjectPlyTarget

    public static final class ObjectPlyTarget.Handle<T>
    extends Object
    A handle for a specific type of element. An instance of this class is returned by the ObjectPlyTarget.register(String, Supplier) method, and allows configuring the handling of individual properties of a certain element type.
    • Method Detail

      • withByte

        public <U extends ByteObjectPlyTarget.Handle<T> withByte​(String propertyName,
                                                                   BiConsumer<T,​U> setter)
        Handle the specified property with the given setter.
        Type Parameters:
        U - The value type
        Parameters:
        propertyName - The property name
        setter - The setter
        Returns:
        This handle
      • withShort

        public <U extends ShortObjectPlyTarget.Handle<T> withShort​(String propertyName,
                                                                     BiConsumer<T,​U> setter)
        Handle the specified property with the given setter.
        Type Parameters:
        U - The value type
        Parameters:
        propertyName - The property name
        setter - The setter
        Returns:
        This handle
      • withInt

        public <U extends IntegerObjectPlyTarget.Handle<T> withInt​(String propertyName,
                                                                     BiConsumer<T,​U> setter)
        Handle the specified property with the given setter.
        Type Parameters:
        U - The value type
        Parameters:
        propertyName - The property name
        setter - The setter
        Returns:
        This handle
      • withFloat

        public <U extends FloatObjectPlyTarget.Handle<T> withFloat​(String propertyName,
                                                                     BiConsumer<T,​U> setter)
        Handle the specified property with the given setter.
        Type Parameters:
        U - The value type
        Parameters:
        propertyName - The property name
        setter - The setter
        Returns:
        This handle
      • withDouble

        public <U extends DoubleObjectPlyTarget.Handle<T> withDouble​(String propertyName,
                                                                       BiConsumer<T,​U> setter)
        Handle the specified property with the given setter.
        Type Parameters:
        U - The value type
        Parameters:
        propertyName - The property name
        setter - The setter
        Returns:
        This handle
      • withCharList

        public ObjectPlyTarget.Handle<T> withCharList​(String propertyName,
                                                      BiConsumer<T,​byte[]> setter)
        Handle the specified property with the given setter.
        Parameters:
        propertyName - The property name
        setter - The setter
        Returns:
        This handle
      • withShortList

        public ObjectPlyTarget.Handle<T> withShortList​(String propertyName,
                                                       BiConsumer<T,​short[]> setter)
        Handle the specified property with the given setter.
        Parameters:
        propertyName - The property name
        setter - The setter
        Returns:
        This handle
      • withIntList

        public ObjectPlyTarget.Handle<T> withIntList​(String propertyName,
                                                     BiConsumer<T,​int[]> setter)
        Handle the specified property with the given setter.
        Parameters:
        propertyName - The property name
        setter - The setter
        Returns:
        This handle
      • withFloatList

        public ObjectPlyTarget.Handle<T> withFloatList​(String propertyName,
                                                       BiConsumer<T,​float[]> setter)
        Handle the specified property with the given setter.
        Parameters:
        propertyName - The property name
        setter - The setter
        Returns:
        This handle
      • withDoubleList

        public ObjectPlyTarget.Handle<T> withDoubleList​(String propertyName,
                                                        BiConsumer<T,​double[]> setter)
        Handle the specified property with the given setter.
        Parameters:
        propertyName - The property name
        setter - The setter
        Returns:
        This handle
      • consume

        public void consume​(Consumer<? super T> consumer)
        Pass the elements to the given consumer when they are finished.
        Parameters:
        consumer - The consumer