Package io.deephaven.engine.table
Interface AttributeMap<TYPE extends AttributeMap<TYPE>>
- All Known Subinterfaces:
GridAttributes<TYPE>
,HierarchicalTable<IFACE_TYPE>
,LazySnapshotTable
,RollupTable
,Table
,TableAdapter
,TableDefaults
,TreeTable
- All Known Implementing Classes:
AppendOnlyArrayBackedInputTable
,BarrageBlinkTable
,BarrageRedirectedTable
,BarrageTable
,BaseGridAttributes
,BaseTable
,DeferredViewTable
,InitialSnapshotTable
,InMemoryTable
,KeyedArrayBackedInputTable
,LiveAttributeMap
,PartitionAwareSourceTable
,QueryReplayGroupedTable
,QueryTable
,QueryTable.FilteredTable
,RedefinableTable
,ReplayGroupedFullTable
,ReplayLastByGroupedTable
,ReplayTable
,ReplayTableBase
,RollupTableImpl
,SimpleSourceTable
,SourceTable
,TimeTable
,TreeTableImpl
,UncoalescedTable
,UpdatableTable
,UpdateSourceQueryTable
public interface AttributeMap<TYPE extends AttributeMap<TYPE>>
Interface for objects (mostly
tables
and similar) that act as an immutable map of key-value attribute
pairs.-
Method Summary
Modifier and TypeMethodDescription@Nullable Object
getAttribute
(@NotNull String key) Get the value for the specified attribute key.Get an immutable set of all the attributes that have values in this AttributeMap.Get all attributes in this AttributeMap.getAttributes
(@NotNull Predicate<String> included) Get all attributes from this AttributeMap whose keys are accepted byincluded
.boolean
hasAttribute
(@NotNull String key) Check if the specified attribute exists in this AttributeMap.retainingAttributes
(@NotNull Collection<String> toRetain) Get an AttributeMap that is the same asthis
, but with only the specified attributes retained.withAttributes
(@NotNull Map<String, Object> toAdd) Get an AttributeMap that is the same asthis
, but with the specified attributes added/replaced.withAttributes
(@NotNull Map<String, Object> toAdd, @NotNull Collection<String> toRemove) Get an AttributeMap that is the same asthis
, but with the specified attributes added/replaced or removed.withoutAttributes
(@NotNull Collection<String> toRemove) Get an AttributeMap that is the same asthis
, but with the specified attributes removed.
-
Method Details
-
withAttributes
@ConcurrentMethod TYPE withAttributes(@NotNull @NotNull Map<String, Object> toAdd, @NotNull @NotNull Collection<String> toRemove) Get an AttributeMap that is the same asthis
, but with the specified attributes added/replaced or removed. If the supplied attributestoAdd
andtoRemove
would not result in any changes tothis
, implementations may returnthis
.- Parameters:
toAdd
- Attribute key-value pairs to add or replace (if the key already exists onthis
). Neither keys nor values may benull
.toRemove
- Attribute keys to remove- Returns:
- The result AttributeMap
- ApiNote:
- If
this
is aTable
, the result will be a childTable
that is identical but for its attributes, and if((Table)this).isRefreshing()
, the result will deliver identicalupdates
tothis
on each cycle., If the result is aLivenessReferent
, it will always be appropriatelymanaged
by the enclosingliveness scope
.
-
withAttributes
Get an AttributeMap that is the same asthis
, but with the specified attributes added/replaced. If the supplied attributestoAdd
would not result in any changes tothis
, implementations may returnthis
.- Parameters:
toAdd
- Attribute key-value pairs to add or replace (if the key already exists onthis
)- Returns:
- The result AttributeMap
- ApiNote:
- If
this
is aTable
, the result will be a childTable
that is identical but for its attributes, and if((Table)this).isRefreshing()
, the result will deliver identicalupdates
tothis
on each cycle., If the result is aLivenessReferent
, it will always be appropriatelymanaged
by the enclosingliveness scope
.
-
withoutAttributes
Get an AttributeMap that is the same asthis
, but with the specified attributes removed. If the supplied attributestoRemove
would not result in any changes tothis
, implementations may returnthis
.- Parameters:
toRemove
- Attribute keys to remove- Returns:
- The result AttributeMap
- ApiNote:
- If
this
is aTable
, the result will be a childTable
that is identical but for its attributes, and if((Table)this).isRefreshing()
, the result will deliver identicalupdates
tothis
on each cycle., If the result is aLivenessReferent
, it will always be appropriatelymanaged
by the enclosingliveness scope
.
-
retainingAttributes
Get an AttributeMap that is the same asthis
, but with only the specified attributes retained. If the supplied attributestoAdd
would not result in any changes tothis
, implementations may returnthis
.- Parameters:
toRetain
- Attribute keys to retain- Returns:
- The result AttributeMap
- ApiNote:
- If
this
is aTable
, the result will be a childTable
that is identical but for its attributes, and if((Table)this).isRefreshing()
, the result will deliver identicalupdates
tothis
on each cycle., If the result is aLivenessReferent
, it will always be appropriatelymanaged
by the enclosingliveness scope
.
-
getAttribute
Get the value for the specified attribute key.- Parameters:
key
- The name of the attribute- Returns:
- The value, or
null
if there was none.
-
getAttributeKeys
Get an immutable set of all the attributes that have values in this AttributeMap.- Returns:
- An immutable set of attribute keys (names)
-
hasAttribute
Check if the specified attribute exists in this AttributeMap.- Parameters:
key
- The key (name) of the attribute- Returns:
true
if the attribute exists
-
getAttributes
Get all attributes in this AttributeMap.- Returns:
- An immutable map containing all attributes from this AttributeMap
-
getAttributes
@ConcurrentMethod @NotNull @NotNull Map<String,Object> getAttributes(@NotNull @NotNull Predicate<String> included) Get all attributes from this AttributeMap whose keys are accepted byincluded
.- Parameters:
included
- A predicate to determine which attribute keys to include- Returns:
- An immutable map containing AttributeMap's attributes whose keys are accepted by
included
-