Class Message.Builder

    • Constructor Detail

      • Builder

        public Builder​(java.lang.String text,
                       Severity severity)
        Creates a new builder that is able to create a proper Message with all needed information.
        Parameters:
        text - The human readable text of this message
        severity - The message's severity: Message.ERROR, Message.WARNING or Message.INFO
      • Builder

        public Builder​(Message message)
        Creates a new builder from a given Message to create a copy of the Message with all information.
        Parameters:
        message - the Message to copy
    • Method Detail

      • code

        public Message.Builder code​(java.lang.String code)
        Set the message's code that identifies the kind of the message.
        Parameters:
        code - A message code that identifies the kind of the message
        Returns:
        This builder instance to directly add further properties
      • text

        public Message.Builder text​(java.lang.String text)
        Set the message's text which is human readable.
        Parameters:
        text - The human readable text of this message
        Returns:
        This builder instance to directly add further properties
      • invalidObjects

        public Message.Builder invalidObjects​(java.util.List<ObjectProperty> invalidObjectProperties)
        Add a list of object properties that the message refers to.
        Parameters:
        invalidObjectProperties - A list of object properties that the message refers to
        Returns:
        This builder instance to directly add further properties
      • invalidObject

        public Message.Builder invalidObject​(ObjectProperty invalidObjectProperty)
        Add an object property that the message refers to.
        Parameters:
        invalidObjectProperty - An object property that the message refers to
        Returns:
        This builder instance to directly add further properties
      • invalidObjects

        public Message.Builder invalidObjects​(ObjectProperty... invalidObjectProperties)
        Add object properties that the message refers to.
        Parameters:
        invalidObjectProperties - Object properties that the message refers to
        Returns:
        This builder instance to directly add further properties
      • invalidObjectWithProperties

        public Message.Builder invalidObjectWithProperties​(java.lang.Object object,
                                                           java.lang.String... properties)
        Add some object properties the message refers to by creating instances of ObjectProperty for every given property and the given object.
        Parameters:
        object - The object the message refers to
        properties - Some properties the message refers to
        Returns:
        This builder instance to directly add further properties
      • replacements

        public Message.Builder replacements​(java.util.List<MsgReplacementParameter> replacementParams)
        A list of replacement parameters the message should reference.
        Parameters:
        replacementParams - a list of replacement parameters
        Returns:
        This builder instance to directly add further properties
      • replacements

        public Message.Builder replacements​(MsgReplacementParameter... replacementParams)
        Some replacement parameters the message should reference.
        Parameters:
        replacementParams - Some replacement parameters
        Returns:
        This builder instance to directly add further properties
      • markers

        public Message.Builder markers​(java.util.Collection<? extends IMarker> markers)
        Set a collection of markers that should be provided to the new message.
        Parameters:
        markers - a set of markers
        Returns:
        This builder instance to directly add further properties
      • markers

        public Message.Builder markers​(IMarker... markers)
        Set some markers that should be provided to the new message.
        Parameters:
        markers - Some markers
        Returns:
        This builder instance to directly add further properties
      • create

        public Message create()
        Creates a new Message with all previously given properties.
        Returns:
        A new message that has the parameters of this builder.