PredicateMap

See javadoc - uk.gov.gchq.koryphe.predicate.PredicateMap

Available since Koryphe version 1.0.0

Examples

Freq map is more than 2

Java
JSON
Full JSON
Python
final PredicateMap function = new PredicateMap("key1", new IsMoreThan(2L));
{
  "class" : "PredicateMap",
  "predicate" : {
    "class" : "IsMoreThan",
    "orEqualTo" : false,
    "value" : {
      "Long" : 2
    }
  },
  "key" : "key1"
}
{
  "class" : "uk.gov.gchq.koryphe.predicate.PredicateMap",
  "predicate" : {
    "class" : "uk.gov.gchq.koryphe.impl.predicate.IsMoreThan",
    "orEqualTo" : false,
    "value" : {
      "java.lang.Long" : 2
    }
  },
  "key" : "key1"
}
g.PredicateMap( 
  predicate=g.IsMoreThan( 
    value={'java.lang.Long': 2}, 
    or_equal_to=False 
  ), 
  key="key1" 
)

Input type:

java.lang.Object

Example inputs:

Input TypeInputResult
uk.gov.gchq.gaffer.types.FreqMap{key1=1}false
uk.gov.gchq.gaffer.types.FreqMap{key1=2}false
uk.gov.gchq.gaffer.types.FreqMap{key1=3}true
uk.gov.gchq.gaffer.types.FreqMap{key1=3, key2=0}true
uk.gov.gchq.gaffer.types.FreqMap{key2=3}false

Freq map is more than or equal to 2

Java
JSON
Full JSON
Python
final PredicateMap function = new PredicateMap("key1", new IsMoreThan(2L, true));
{
  "class" : "PredicateMap",
  "predicate" : {
    "class" : "IsMoreThan",
    "orEqualTo" : true,
    "value" : {
      "Long" : 2
    }
  },
  "key" : "key1"
}
{
  "class" : "uk.gov.gchq.koryphe.predicate.PredicateMap",
  "predicate" : {
    "class" : "uk.gov.gchq.koryphe.impl.predicate.IsMoreThan",
    "orEqualTo" : true,
    "value" : {
      "java.lang.Long" : 2
    }
  },
  "key" : "key1"
}
g.PredicateMap( 
  key="key1", 
  predicate=g.IsMoreThan( 
    or_equal_to=True, 
    value={'java.lang.Long': 2} 
  ) 
)

Input type:

java.lang.Object

Example inputs:

Input TypeInputResult
uk.gov.gchq.gaffer.types.FreqMap{key1=1}false
uk.gov.gchq.gaffer.types.FreqMap{key1=2}true
uk.gov.gchq.gaffer.types.FreqMap{key1=3}true
uk.gov.gchq.gaffer.types.FreqMap{key1=3, key2=0}true
uk.gov.gchq.gaffer.types.FreqMap{key2=3}false

Map with date key has a value that exists

Java
JSON
Full JSON
Python
final PredicateMap function = new PredicateMap(new Date(0L), new Exists());
{
  "class" : "PredicateMap",
  "predicate" : {
    "class" : "Exists"
  },
  "key" : {
    "Date" : 0
  }
}
{
  "class" : "uk.gov.gchq.koryphe.predicate.PredicateMap",
  "predicate" : {
    "class" : "uk.gov.gchq.koryphe.impl.predicate.Exists"
  },
  "key" : {
    "java.util.Date" : 0
  }
}
g.PredicateMap( 
  predicate=g.Exists(), 
  key={'java.util.Date': 0} 
)

Input type:

java.lang.Object

Example inputs:

Input TypeInputResult
java.util.HashMap{Thu Jan 01 00:00:00 UTC 1970=1}true
java.util.HashMap{Thu Oct 04 09:33:23 UTC 2018=2}false

results matching ""

    No results matching ""