Class ColumnRestrictionRegistry
java.lang.Object
io.deephaven.web.client.api.barrage.util.ColumnRestrictionRegistry
Registry for column restriction converters. Built-in restriction types are handled by typed subclasses of
ColumnRestriction and are pre-registered here. Downstream consumers can register
additional custom types via register(java.lang.String, io.deephaven.web.client.api.barrage.util.ColumnRestrictionConverter); their converter must return a concrete subclass that overrides
validate() as needed.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<ColumnRestriction> convert(com.google.protobuf.Any restrictionAny) Converts the given Any to a ColumnRestriction, if possible.static voidregister(String typeUrl, ColumnRestrictionConverter converter) Register a converter for a custom column restriction type.
-
Constructor Details
-
ColumnRestrictionRegistry
public ColumnRestrictionRegistry()
-
-
Method Details
-
register
Register a converter for a custom column restriction type. The converter is responsible for returning a concreteColumnRestrictionsubclass that implementsvalidate()as needed.- Parameters:
typeUrl- The full protobufAnytype URL (e.g.,"docs.deephaven.io/io.deephaven.proto.backplane.grpc.MyCustomRestriction")converter- Converts a protobufAnymessage into a typedColumnRestriction
-
convert
public static Optional<ColumnRestriction> convert(com.google.protobuf.Any restrictionAny) throws ColumnRestrictionConverterException Converts the given Any to a ColumnRestriction, if possible. Returns empty if the type is unknown, or throws if the data is invalid for the given type.- Parameters:
restrictionAny- The Any restriction to convert- Returns:
- An optional containing the converted ColumnRestriction, or empty if the type is unknown
- Throws:
ColumnRestrictionConverterException- if the data cannot be converted
-