Interface ValueHolder

  • All Superinterfaces:
    java.lang.Iterable<java.util.Map.Entry<java.lang.String,​java.lang.Object>>
    All Known Implementing Classes:
    Values

    public interface ValueHolder
    extends java.lang.Iterable<java.util.Map.Entry<java.lang.String,​java.lang.Object>>
    The ValueHolder instance allows to declare an arbitrary class as a ValueHolder to be used in various methods of the SQLBuilder, for example Where.where(ValueHolder). Instead of passing all values of an object manually, this interface can be used to extract multiple values at once from any object of classes that implement it.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  ValueHolder.EntryWrapper
      The EntryWrapper is a wrapper around the Map.Entry class to support automatic key prefixing.
      static class  ValueHolder.ValueEntry
      The ValueEntry class is an implementation of the Map.Entry class
    • Method Summary

      All Methods Static Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      static java.util.Map.Entry<java.lang.String,​java.lang.Object> entry​(java.lang.String string, java.lang.Object object)
      Creates a new Map.Entry instance
      static ValueHolder from​(java.lang.Iterable<? extends java.util.Map.Entry<java.lang.String,​java.lang.Object>> it)
      Create a ValueHolder from an Iterable instance
      static ValueHolder from​(java.util.Map<java.lang.String,​java.lang.Object> map)
      Creates a ValueHolder instance from a Map instance
      default java.util.Iterator<java.util.Map.Entry<java.lang.String,​java.lang.Object>> iterator()  
      default java.util.Iterator<java.util.Map.Entry<java.lang.String,​java.lang.Object>> values​(java.lang.String columnPrefix)
      Returns the values stored in this ValueHolder.
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Method Detail

      • from

        static ValueHolder from​(java.lang.Iterable<? extends java.util.Map.Entry<java.lang.String,​java.lang.Object>> it)
        Create a ValueHolder from an Iterable instance
        Parameters:
        it - The Iterable
        Returns:
        the ValueHolder instance
      • from

        static ValueHolder from​(java.util.Map<java.lang.String,​java.lang.Object> map)
        Creates a ValueHolder instance from a Map instance
        Parameters:
        map - The Map
        Returns:
        the ValueHolder instance
      • entry

        static java.util.Map.Entry<java.lang.String,​java.lang.Object> entry​(java.lang.String string,
                                                                                  java.lang.Object object)
        Creates a new Map.Entry instance
        Parameters:
        string - the key
        object - the value
        Returns:
        the new Map.Entry instance
      • iterator

        default java.util.Iterator<java.util.Map.Entry<java.lang.String,​java.lang.Object>> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<java.util.Map.Entry<java.lang.String,​java.lang.Object>>
      • values

        default java.util.Iterator<java.util.Map.Entry<java.lang.String,​java.lang.Object>> values​(java.lang.String columnPrefix)
        Returns the values stored in this ValueHolder. Optionally prefixes the keys with a column prefix.
        Parameters:
        columnPrefix - The optional columnPrefix. Pass null to disable. Pass a value to prefix all keys with this prefix. The prefix and the key are joined with a "."
        Returns:
        The value iterator