Enum ETradeReason

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ETradeReason>

    public enum ETradeReason
    extends java.lang.Enum<ETradeReason>
    The various reasons for trading a ware.
    Author:
    Andi Hotz, (c) Sahits GmbH, 2017 Created on Oct 08, 2017
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean buyReason  
      private int prio  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ETradeReason​(boolean buyReason, int prio)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Comparator<ETradeReason> comparator()  
      boolean isBuyReason()
      Is the reason a buy reason.
      static ETradeReason valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ETradeReason[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • REQUIRE_FOR_PRODUCTION

        public static final ETradeReason REQUIRE_FOR_PRODUCTION
        Ware is required for production in players workshops
      • REQUIRE_FOR_BASIC_NEEDS

        public static final ETradeReason REQUIRE_FOR_BASIC_NEEDS
        Ware is required to cover basic needs in city
      • PRODUCED_WARE_IN_WORKSHOP

        public static final ETradeReason PRODUCED_WARE_IN_WORKSHOP
        Ware is produced in players workshop
      • PRODUCED_WARE_IN_CITY

        public static final ETradeReason PRODUCED_WARE_IN_CITY
        Ware is produced in the city
      • REQUIRE_FOR_CITY_PRODUCTION

        public static final ETradeReason REQUIRE_FOR_CITY_PRODUCTION
        Ware is required for production in the city
    • Field Detail

      • buyReason

        private final boolean buyReason
      • prio

        private final int prio
    • Constructor Detail

      • ETradeReason

        private ETradeReason​(boolean buyReason,
                             int prio)
    • Method Detail

      • values

        public static ETradeReason[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ETradeReason c : ETradeReason.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ETradeReason valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • isBuyReason

        public boolean isBuyReason()
        Is the reason a buy reason.
        Returns:
        true if it is a buy reason
      • comparator

        public static java.util.Comparator<ETradeReason> comparator()