Class MapPair<K,V>

java.lang.Object
org.aksw.jena_sparql_api.conjure.utils.MapPair<K,V>
Type Parameters:
K -
V -

public class MapPair<K,V> extends Object
A bundle of two maps, with the purpose of denoting a primary association between values of K and V while also allowing for relating Vs to Ks. Use case: The primary file extension for content type 'application/turtle' is 'ttl', However, the file extension 'turtle' is understood as an alternative of that content type. In consequence: writes makes use of the primary file extension, whereas reads can make use of the alternative ones.
Author:
raven
  • Field Details

    • primary

      protected Map<K,V> primary
    • alternatives

      protected Map<V,K> alternatives
  • Constructor Details

    • MapPair

      public MapPair()
  • Method Details

    • getPrimary

      public Map<K,V> getPrimary()
    • getAlternatives

      public Map<V,K> getAlternatives()
    • putPrimary

      public MapPair<K,V> putPrimary(K key, V value)
      Convenience method to set a primary mapping and its reverse mapping
      Parameters:
      key -
      value -
      Returns: