public class NamespaceUtil extends Object
Namespace
s.Constructor and Description |
---|
NamespaceUtil() |
Modifier and Type | Method and Description |
---|---|
static <T> Namespace<T> |
merge(Namespace<? extends T>... namespaces)
Merges the specified namespaces into a new namespace, handling name collisions
by renaming.
|
static <T> Namespace<T> |
overlay(Namespace<? extends T>... namespaces)
Merges the specified namespaces into a new namespace, handling name collisions
with a last-one-wins mechanism.
|
static <T> Namespace<T> |
remove(Namespace<T> namespace,
Collection<String> excludeFields)
Creates a new namespace from an existing one, removing any fields matching the
provided set of names.
|
static <T> Namespace<T> |
remove(Namespace<T> namespace,
String... excludeFields)
Creates a new namespace from an existing one, removing any fields matching the
provided set of names.
|
static <T> Namespace<T> |
retain(Namespace<T> namespace,
Collection<String> retainFields)
Creates a new namespace from an existing one, copying any fields contained the
provided set of names.
|
static <T> Namespace<T> |
retain(Namespace<T> namespace,
String... retainFields)
Creates a new namespace from an existing one, copying any fields matching the
provided set of names.
|
static <T> Namespace<T> |
select(Namespace<T> namespace,
List<String> selectFields)
Creates a new namespace from an existing one, copying the specified fields.
|
static <T> Namespace<T> |
select(Namespace<T> namespace,
String... selectFields)
Creates a new namespace from an existing one, copying the specified fields.
|
static <T> Namespace<T> |
wrap(String prefix,
List<? extends T> flows)
Creates a new namespace with the specified flows.
|
static <T> Namespace<T> |
wrap(String prefix,
T... flows)
Creates a new namespace with the specified flows.
|
static <T> Namespace<T> |
wrap(String name,
T flow)
Creates a new namespace with specified flow as the named field.
|
public static <T> Namespace<T> retain(Namespace<T> namespace, Collection<String> retainFields)
Unlike select(Namespace, String...)
, the provided names do not
have to be valid fields in the namespace.
T
- the type of elements in the namespacenamespace
- the source namespace to copyretainFields
- the names of fields which should be copiedpublic static <T> Namespace<T> retain(Namespace<T> namespace, String... retainFields)
Unlike select(Namespace, String...)
, the provided names do not
have to be valid fields in the namespace.
T
- the type of elements in the namespacenamespace
- the source namespace to copyretainFields
- the names of fields which should be copiedpublic static <T> Namespace<T> remove(Namespace<T> namespace, Collection<String> excludeFields)
The provided names do not have to be valid fields in the namespace.
T
- the type of elements in the namespacenamespace
- the source namespace to copyexcludeFields
- the names of fields which should be droppedpublic static <T> Namespace<T> remove(Namespace<T> namespace, String... excludeFields)
The provided names do not have to be valid fields in the namespace.
T
- the type of elements in the namespacenamespace
- the source namespace to copyexcludeFields
- the names of fields which should be droppedpublic static <T> Namespace<T> select(Namespace<T> namespace, List<String> selectFields)
T
- the type of elements in the namespacenamespace
- the source namespace to copyselectFields
- the names of fields which should be copiedpublic static <T> Namespace<T> select(Namespace<T> namespace, String... selectFields)
T
- the type of elements in the namespacenamespace
- the source namespace to copyselectFields
- the names of fields which should be copiedpublic static <T> Namespace<T> wrap(String name, T flow)
T
- the type of elements in the namespacename
- the name for the fieldflow
- the flow containing the field datapublic static <T> Namespace<T> wrap(String prefix, T... flows)
prefix + i
,
where i
is the flow's 0-based position in the input list.T
- the type of elements in the namespaceprefix
- the field name prefix for each flowflows
- the flows containing field datapublic static <T> Namespace<T> wrap(String prefix, List<? extends T> flows)
prefix + i
,
where i
is the flow's 0-based position in the input list.T
- the type of elements in the namespaceprefix
- the field name prefix for each flowflows
- the flows containing field datapublic static <T> Namespace<T> merge(Namespace<? extends T>... namespaces)
The following conditions will hold with respect to the ordering of fields in the result:
For a destructive merge which overwrites mappings in collision, use
overlay(Namespace...)
instead.
T
- the type of elements in the namespacenamespaces
- the namespaces to mergepublic static <T> Namespace<T> overlay(Namespace<? extends T>... namespaces)
The following conditions will hold with respect to the ordering of fields in the result:
For a non-destructive merge which doesn't replace collisions, use
merge(Namespace...)
instead.
T
- the type of elements in the namespacenamespaces
- the namespaces to mergeCopyright © 2024 Actian Corporation. All rights reserved.