Class EnumValueGenerator<Context extends GeneratorContext<Context>,E extends net.morimekta.providence.PEnumValue<E>>

  • All Implemented Interfaces:
    Generator<Context,java.lang.Integer>

    public class EnumValueGenerator<Context extends GeneratorContext<Context>,E extends net.morimekta.providence.PEnumValue<E>>
    extends java.lang.Object
    implements Generator<Context,java.lang.Integer>
    Generator helper class for enum value (asInteger) of the selected enum.
    • Constructor Summary

      Constructors 
      Constructor Description
      EnumValueGenerator​(E... selection)  
      EnumValueGenerator​(net.morimekta.providence.descriptor.PEnumDescriptor<E> descriptor)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Integer generate​(Context ctx)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EnumValueGenerator

        public EnumValueGenerator​(net.morimekta.providence.descriptor.PEnumDescriptor<E> descriptor)
      • EnumValueGenerator

        @SafeVarargs
        public EnumValueGenerator​(E... selection)
    • Method Detail

      • generate

        public java.lang.Integer generate​(Context ctx)
        Specified by:
        generate in interface Generator<Context extends GeneratorContext<Context>,E extends net.morimekta.providence.PEnumValue<E>>
        Parameters:
        ctx - The context to use when generating.
        Returns:
        The generated value.