Class CustomerSegmentType

  • All Implemented Interfaces:
    Serializable

    public class CustomerSegmentType
    extends Object
    implements Serializable
    Extensible enumeration defining customer segment types. (e.g. RULE_BASED, CUSTOMER_SET)

    Consumers wishing to add additional CustomerSegment types should extend this class with an implementation similar to the following:

     {
         @code
         public class CustomerSetSegmentType extends CustomerSegmentType {
    
             public static final CustomerSegmentType CUSTOMER_SET =
                     new CustomerSetSegmentType("CUSTOMER_SET", true);
    
             protected CustomerSetSegmentType(String type, boolean includeCustomers) {
                 super(type, includeCustomers);
             }
         }
     }
     

    For proper initialization, configuration is required. For example, to configure the type defined above, we would add the annotation CustomerSegmentTypes to a Spring @Configuration class as such:

     {
         @code
         @CustomerSegmentTypes({CustomerSetSegmentType.class})
         @Configuration
         public class SpringConfigurationClass {}
     }
     
    See Also:
    CustomerSegmentTypes, Serialized Form
    • Field Detail

      • RULE_BASED

        public static final CustomerSegmentType RULE_BASED
        A rule based segment type. Segments of this type require specific criteria to be met for a customer to qualify.
      • CUSTOMER_SET

        public static final CustomerSegmentType CUSTOMER_SET
        A segment type with a pre-defined set of customers.
    • Constructor Detail

      • CustomerSegmentType

        protected CustomerSegmentType​(@NonNull
                                      @NonNull String type,
                                      boolean manuallyAddCustomers)
        Constructs a CustomerSegmentType. The convention is to use all capital letters with spaces represented as underscores (_)

        manuallyAddCustomers indicates whether or not individual customers may be added to this segment type. Attempts to add a customer to, say, a rule based segment are likely a mistake in logic.

        Parameters:
        type - the type of this customer segment
        manuallyAddCustomers - Can individual customers be manually added to this segment type?
    • Method Detail

      • getType

        public final String getType()
        Returns:
        The String representation of this segment type.
      • canManuallyAddCustomers

        public final boolean canManuallyAddCustomers()
        Returns:
        Can individual customers be added to this segment type?
      • getInstance

        public static CustomerSegmentType getInstance​(String type)
        Returns an instance of a customer segment based on its String type.
        Parameters:
        type - The type of this Customer Segment
      • canEqual

        protected boolean canEqual​(Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object