Class AugmentationGroupingResolver<G extends org.opendaylight.yangtools.yang.binding.DataObject,T extends org.opendaylight.yangtools.yang.binding.Augmentable<T>>
- java.lang.Object
-
- org.opendaylight.openflowplugin.extension.api.AugmentationGroupingResolver<G,T>
-
- Type Parameters:
G
- Grouping typeT
- Augmentable type
- All Implemented Interfaces:
org.opendaylight.yangtools.concepts.Immutable
,org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Immutable>
@Beta public final class AugmentationGroupingResolver<G extends org.opendaylight.yangtools.yang.binding.DataObject,T extends org.opendaylight.yangtools.yang.binding.Augmentable<T>> extends Object implements org.opendaylight.yangtools.concepts.Immutable
Resolver providing a bridge between a grouping and its various instantiations via augment. This is useful for extracting the grouping's content from a DataObject's augmentations without knowing from which instantiation it comes from.Typical use case is, given a base grouping module:
module foo; grouping foo { container augmentable { } }
and a module independent of it:module bar; container bar { uses foo:foo; }
andmodule baz; container baz { uses foo:foo; }
an external module can perform:module xyzzy; import bar { prefix bar; } import baz { prefix baz; } grouping something { // ... } augment /bar:bar/bar:augmentable { uses something; } augment /baz:baz/baz:augmentable { uses something; }
The augmentations ofbar
andbaz
instantiations ofgrouping foo
have an equivalent augmentation introduced byxyzzy
. This equivalence is not expressed is generated code, in that it is not apparent givenbar
orbaz
there is an augmentation which providessomething
.This class provides the static knowledge to ask for the contents of
something
given an instance ofaugmentable
, without knowing which augmentation introduces it.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AugmentationGroupingResolver.Builder<G extends org.opendaylight.yangtools.yang.binding.DataObject,T extends org.opendaylight.yangtools.yang.binding.Augmentable<T>>
static class
AugmentationGroupingResolver.Factory<T extends org.opendaylight.yangtools.yang.binding.Augmentable<T>>
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <G extends org.opendaylight.yangtools.yang.binding.DataObject,T extends org.opendaylight.yangtools.yang.binding.Augmentable<T>>
@NonNull AugmentationGroupingResolver.Builder<G,T>builder(Class<G> groupingClass)
static <T extends org.opendaylight.yangtools.yang.binding.Augmentable<T>>
@NonNull AugmentationGroupingResolver.Factory<T>factory(Class<T> augmentableClass, Set<Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<T>>> augmentationClasses)
@NonNull Optional<G>
findExtension(T data)
-
-
-
Method Detail
-
builder
public static <G extends org.opendaylight.yangtools.yang.binding.DataObject,T extends org.opendaylight.yangtools.yang.binding.Augmentable<T>> @NonNull AugmentationGroupingResolver.Builder<G,T> builder(Class<G> groupingClass)
-
factory
public static <T extends org.opendaylight.yangtools.yang.binding.Augmentable<T>> @NonNull AugmentationGroupingResolver.Factory<T> factory(Class<T> augmentableClass, Set<Class<? extends org.opendaylight.yangtools.yang.binding.Augmentation<T>>> augmentationClasses)
-
-