Class MessageStoreUtils


  • public class MessageStoreUtils
    extends java.lang.Object
    Utilities for message store implementations and interfaces.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <M extends net.morimekta.providence.PMessage<M,F>,F extends net.morimekta.providence.descriptor.PField,B extends net.morimekta.providence.PMessageBuilder<M,F>>
      java.util.List<M>
      buildAll​(java.util.Collection<B> builders)
      Build all items of the collection containing builders.
      static <M extends net.morimekta.providence.PMessage<M,F>,F extends net.morimekta.providence.descriptor.PField,B extends net.morimekta.providence.PMessageBuilder<M,F>>
      M
      buildIfNotNull​(B builder)
      Build the message from builder if it is not null.
      static <M extends net.morimekta.providence.PMessage<M,F>,F extends net.morimekta.providence.descriptor.PField,B extends net.morimekta.providence.PMessageBuilder<M,F>>
      java.util.List<B>
      mutateAll​(java.util.Collection<M> messages)
      Mutate all items of the collection containing messages.
      static <M extends net.morimekta.providence.PMessage<M,F>,F extends net.morimekta.providence.descriptor.PField,B extends net.morimekta.providence.PMessageBuilder<M,F>>
      B
      mutateIfNotNull​(M message)
      Mutate the message if it is not null.
      • Methods inherited from class java.lang.Object

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

      • MessageStoreUtils

        public MessageStoreUtils()
    • Method Detail

      • buildAll

        public static <M extends net.morimekta.providence.PMessage<M,F>,F extends net.morimekta.providence.descriptor.PField,B extends net.morimekta.providence.PMessageBuilder<M,F>> java.util.List<M> buildAll​(java.util.Collection<B> builders)
        Build all items of the collection containing builders. The list must not contain any null items.
        Type Parameters:
        M - The message type.
        F - The field type.
        B - The builder type.
        Parameters:
        builders - List of builders.
        Returns:
        List of messages or null if null input.
      • mutateAll

        public static <M extends net.morimekta.providence.PMessage<M,F>,F extends net.morimekta.providence.descriptor.PField,B extends net.morimekta.providence.PMessageBuilder<M,F>> java.util.List<B> mutateAll​(java.util.Collection<M> messages)
        Mutate all items of the collection containing messages. The list must not contain any null items.
        Type Parameters:
        M - The message type.
        F - The field type.
        B - The builder type.
        Parameters:
        messages - List of messages
        Returns:
        List of builders or null if null input.
      • buildIfNotNull

        public static <M extends net.morimekta.providence.PMessage<M,F>,F extends net.morimekta.providence.descriptor.PField,B extends net.morimekta.providence.PMessageBuilder<M,F>> M buildIfNotNull​(B builder)
        Build the message from builder if it is not null.
        Type Parameters:
        M - The message type.
        F - The field type.
        B - The builder type.
        Parameters:
        builder - The builder to build.
        Returns:
        The message or null if null input.
      • mutateIfNotNull

        public static <M extends net.morimekta.providence.PMessage<M,F>,F extends net.morimekta.providence.descriptor.PField,B extends net.morimekta.providence.PMessageBuilder<M,F>> B mutateIfNotNull​(M message)
        Mutate the message if it is not null.
        Type Parameters:
        M - The message type.
        F - The field type.
        B - The builder type.
        Parameters:
        message - Message to mutate.
        Returns:
        The builder or null if null input.