Class PostalAddress.Builder

  • Enclosing class:
    PostalAddress

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

      • setStreet

        public PostalAddress.Builder setStreet​(java.lang.String pStreet)
        Method sets attribute street.
        Parameters:
        pStreet - Value to which street should be set.
        Returns:
        PostalAddress.Builder Instance of this builder to support chaining setters. Method never returns null.
      • setCity

        public PostalAddress.Builder setCity​(java.lang.String pCity)
        Method sets attribute city.
        Parameters:
        pCity - Value to which city should be set.
        Returns:
        PostalAddress.Builder Instance of this builder to support chaining setters. Method never returns null.
      • build

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

        public PostalAddress buildValidated()
                                     throws javax.validation.ConstraintViolationException
        Method creates a new validated instance of class PostalAddress. The object will be initialized with the values of the builder and validated afterwards.
        Returns:
        PostalAddress 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.