public static < T > Optional < Map < T , NullableValue > > extractFixedValues ( TupleDomain < T > tupleDomain ) { if ( ! tupleDomain . getDomains ( ) . isPresent ( ) ) { return Optional . empty ( ) ; } return Optional . of ( tupleDomain . getDomains ( ) . get ( ) . entrySet ( ) . stream ( ) . filter ( entry -> entry . getValue ( ) . isNullableSingleValue ( ) ) . collect ( toLinkedMap ( Map . Entry :: getKey , entry -> new NullableValue ( entry . getValue ( ) . getType ( ) , entry . getValue ( ) . getNullableSingleValue ( ) ) ) ) ) ; }
Extract all column constraints that require exactly one value or only null in their respective Domains . Returns an empty Optional if the Domain is none .