Class Message.Builder

  • Enclosing class:
    Message

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Message build()
      Method creates a new instance of class Message.
      Message buildValidated()
      Method creates a new validated instance of class Message.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Builder

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

      • build

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

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