java.lang.Object
java.lang.Enum<PostalService>
com.github.rvesse.airline.examples.sendit.PostalService
All Implemented Interfaces:
Serializable, Comparable<PostalService>, Constable

public enum PostalService extends Enum<PostalService>
Grades of postal service
  • Enum Constant Details

  • Field Details

    • pricePerKilogram

      private final double pricePerKilogram
  • Constructor Details

    • PostalService

      private PostalService(double pricePerKilogram)
  • Method Details

    • values

      public static PostalService[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PostalService valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • calculateCost

      public double calculateCost(double weight)
      Calculate the cost of a parcel
      Parameters:
      weight - Parcel weight
      Returns:
      Cost