Class JoinKey


  • public final class JoinKey
    extends Object
    Combination of a left key and a right key.
    • Constructor Detail

      • JoinKey

        public JoinKey​(String name)
        Create a key where the left name and right name are the same.
        Parameters:
        name - Name of the key field on both the left and right
      • JoinKey

        public JoinKey​(String leftName,
                       String rightName)
        Create a key using the specified left and right name
        Parameters:
        leftName - Name of the key on the left
        rightName - Name of the key on the right
    • Method Detail

      • getLeftName

        public String getLeftName()
        Get the left field name associated with this key.
        Returns:
        Name of the key field
      • getRightName

        public String getRightName()
        Get the right field name associated with this key.
        Returns:
        Name of the key field
      • toString

        public String toString()
        Pretty-print this JoinKey.
        Overrides:
        toString in class Object
        Returns:
        String containing field name and associated ordering
      • keys

        public static JoinKey[] keys​(String... names)
        Create multiple keys.
        Parameters:
        names - names of the keys on the left and right
        Returns:
        Join keys, in the same order as the supplied field names
      • makeJoinKeys

        public static JoinKey[] makeJoinKeys​(String[] leftKeyNames,
                                             String[] rightKeyNames)
        Create multiple keys.
        Parameters:
        leftKeyNames - names of the keys on the left
        rightKeyNames - names of the keys on the right
        Returns:
        Join keys, in the same order as the supplied field names
      • getLeftNames

        public static String[] getLeftNames​(JoinKey... joinKeys)
        Extract the left field names from several keys.
        Parameters:
        joinKeys - Keys from which to get the field names
        Returns:
        Field names for the keys, in the same order as the supplied keys
      • getRightNames

        public static String[] getRightNames​(JoinKey... joinKeys)
        Extract the right field names from several keys.
        Parameters:
        joinKeys - Keys from which to get the field names
        Returns:
        Field names for the keys, in the same order as the supplied keys