Class Leg.Builder

  • Enclosing class:
    Leg

    public static class Leg.Builder
    extends java.lang.Object
    Class implements builder to create a new instance of class Leg.
    • Constructor Detail

      • Builder

        protected Builder()
        Use Leg.builder() instead of private constructor to create new builder.
      • Builder

        protected Builder​(Leg pObject)
        Use Leg.builder(Leg) instead of private constructor to create new builder.
    • Method Detail

      • setStart

        public Leg.Builder setStart​(PlaceRef pStart)
        Method sets association start.
        Parameters:
        pStart - Value to which start should be set.
        Returns:
        Leg.Builder Instance of this builder to support chaining setters. Method never returns null.
      • setStop

        public Leg.Builder setStop​(PlaceRef pStop)
        Method sets association stop.
        Parameters:
        pStop - Value to which stop should be set.
        Returns:
        Leg.Builder Instance of this builder to support chaining setters. Method never returns null.
      • setStopovers

        public Leg.Builder setStopovers​(java.util.List<PlaceRef> pStopovers)
        Method sets association stopovers.
        Parameters:
        pStopovers - Collection to which stopovers should be set.
        Returns:
        Leg.Builder Instance of this builder to support chaining setters. Method never returns null.
      • build

        public Leg build()
        Method creates a new instance of class Leg. The object will be initialized with the values of the builder.
        Returns:
        Leg Created object. The method never returns null.
      • buildValidated

        public Leg buildValidated()
                           throws javax.validation.ConstraintViolationException
        Method creates a new validated instance of class Leg. The object will be initialized with the values of the builder and validated afterwards.
        Returns:
        Leg Created and validated object. The method never returns null.
        Throws:
        javax.validation.ConstraintViolationException - in case that one or more validations for the created object failed.