Class JsonBuffer


  • public class JsonBuffer
    extends Object
    Basic Json buffer.
    Since:
    14.0
    Version:
    17.0 2020-01-04 14:41:35
    Author:
    Stéphane GALLAND
    Maven Group Id:
    org.arakhne.afc.core
    Maven Artifact Id:
    vmutils
    • Constructor Detail

      • JsonBuffer

        public JsonBuffer()
    • Method Detail

      • isEmpty

        public boolean isEmpty()
        Replies if the buffer is empty or not.
        Returns:
        true if the buffer is empty. false if the buffer is not empty.
        Since:
        15.0
      • add

        public void add​(String name,
                        Object value)
        Add the given value.
        Parameters:
        name - the name.
        value - the value.
      • add

        public void add​(String name,
                        Iterable<?> value)
        Add the given value.
        Parameters:
        name - the name.
        value - the value.
      • add

        public void add​(String name,
                        Map<?,​?> value)
        Add the given value.
        Parameters:
        name - the name.
        value - the value.
      • add

        public void add​(String name,
                        JsonBuffer value)
        Add the given value.
        Parameters:
        name - the name.
        value - the value.
      • retainAll

        public void retainAll​(String... keys)
        Keep the specified keys into the Json and remove the other keys.
        Parameters:
        keys - the names of the keys.
        Since:
        16.0
      • clear

        public void clear()
        Remove all the keys.
        Since:
        16.0
      • toString

        public static String toString​(String name,
                                      Object value,
                                      Object... otherPairs)
        Build the Json string representation of the given pairs.
        Parameters:
        name - the name of the first attribute.
        value - the value of the first attribute.
        otherPairs - the other pairs.
        Returns:
        the string representation.
      • toString

        public static String toString​(JsonableObject value)
        Build the Json string representation of the given value.
        Parameters:
        value - the value of the first attribute.
        Returns:
        the string representation.
        Since:
        15.0