/**
* Wrapper over augmentation and it's type in order to ease handing over and hooking of an augmentation
- * @param <EXT_POINT> augmentable type where wrapped augmentation belongs
+ * @param <E> augmentable type where wrapped augmentation belongs
*/
-public class AugmentTuple<EXT_POINT extends Augmentable<EXT_POINT>> {
+public class AugmentTuple<E extends Augmentable<E>> {
- private final Augmentation<EXT_POINT> augmentationObject;
- private final Class<? extends Augmentation<EXT_POINT>> augmentationClass;
+ private final Augmentation<E> augmentationObject;
+ private final Class<? extends Augmentation<E>> augmentationClass;
/**
* @param augmentationClass
* @param augmentationObject
*/
- public AugmentTuple(Class<? extends Augmentation<EXT_POINT>> augmentationClass, Augmentation<EXT_POINT> augmentationObject) {
+ public AugmentTuple(Class<? extends Augmentation<E>> augmentationClass, Augmentation<E> augmentationObject) {
this.augmentationClass = augmentationClass;
this.augmentationObject = augmentationObject;
}
/**
* @return instance of wrapped augmentation
*/
- public Augmentation<EXT_POINT> getAugmentationObject() {
+ public Augmentation<E> getAugmentationObject() {
return augmentationObject;
}
/**
* @return type of wrapped augmentation
*/
- public Class<? extends Augmentation<EXT_POINT>> getAugmentationClass() {
+ public Class<? extends Augmentation<E>> getAugmentationClass() {
return augmentationClass;
}
}
* lookup and register key for extension converters, basic case expects this to
* correlate with input model type
*
- * @param <TYPE> type of key
+ * @param <T> type of key
*/
-public class ConverterExtensionKey<TYPE extends ExtensionKey> extends TypeVersionKey<TYPE> {
-
- private Class<TYPE> type;
- private short ofVersion;
+public class ConverterExtensionKey<T extends ExtensionKey> extends TypeVersionKey<T> {
/**
* @param type
*/
- public ConverterExtensionKey(Class<TYPE> type, short ofVersion) {
+ public ConverterExtensionKey(Class<T> type, short ofVersion) {
super(type, ofVersion);
}
}
/**
* convert message from OFJava-API model into MD-SAL model
*
- * @param <FROM> input message model - OFJava-API
- * @param <PATH> represents possible paths in yang schema for augmentations
+ * @param <F> input message model - OFJava-API
+ * @param <P> represents possible paths in yang schema for augmentations
*/
-public interface ConvertorActionFromOFJava<FROM extends DataContainer, PATH extends AugmentationPath> {
+public interface ConvertorActionFromOFJava<F extends DataContainer, P extends AugmentationPath> {
/**
* @param input
* @param path in yang schema where a converted value has to be augmented
* @return message converted to MD-SAL and its type
*/
- Action convert(FROM input, PATH path);
+ Action convert(F input, P path);
}
/**
* convert message from MD-SAL model into OFJava-API model
- * @param <FROM> input message model - MD-SAL model
- * @param <TO> output message model - OFJava-API
+ * @param <F> input message model - MD-SAL model
+ * @param <T> output message model - OFJava-API
*/
-public interface ConvertorActionToOFJava<FROM extends Action, TO extends DataContainer> {
+public interface ConvertorActionToOFJava<F extends Action, T extends DataContainer> {
/**
* @param actionCase where is vendor's augmentation
* @return message converted to OFJava-API
*/
- TO convert(FROM actionCase);
+ T convert(F actionCase);
}
/**
* convert message from OFJava-API model into MD-SAL model
*
- * @param <FROM> input message model - OFJava-API
- * @param <PATH> represents possible paths in yang schema for augmentations
+ * @param <F> input message model - OFJava-API
+ * @param <P> represents possible paths in yang schema for augmentations
*/
-public interface ConvertorFromOFJava<FROM extends DataContainer, PATH extends AugmentationPath> {
+public interface ConvertorFromOFJava<F extends DataContainer, P extends AugmentationPath> {
/**
* @param input
* @param path in yang schema where a converted value has to be augmented
* @return message converted to MD-SAL and its type
*/
- ExtensionAugment<? extends Augmentation<Extension>> convert(FROM input, PATH path);
+ ExtensionAugment<? extends Augmentation<Extension>> convert(F input, P path);
}
/**
* convert message from MD-SAL model into OFJava-API model
*
- * @param <TO> output message model - OFJava-API
+ * @param <T> output message model - OFJava-API
*/
-public interface ConvertorToOFJava<TO extends DataContainer> {
+public interface ConvertorToOFJava<T extends DataContainer> {
/**
* @param extension where is vendor's augmentation
* @return message converted to OFJava-API
*/
- TO convert(Extension extension);
+ T convert(Extension extension);
}
* corresponding {@link Augmentation}s (1:1..n binding). And those {@link Augmentation}s
* are sharing the same grouping so that they could be processed in the same way.
*
- * @param <GROUPING>
+ * @param <G> grouping
*/
-public class GroupingLooseResolver<GROUPING> {
+public class GroupingLooseResolver<G> {
- Class<GROUPING> commonInterface;
+ Class<G> commonInterface;
Set<Class<? extends Augmentation<?>>> classes;
/**
* @param commonInterface
* @param common grouping Interface
*/
- public GroupingLooseResolver(Class<GROUPING> commonInterface) {
+ public GroupingLooseResolver(Class<G> commonInterface) {
this.commonInterface = commonInterface;
classes = new HashSet<>();
}
* @param cls equivalent augmentation class
* @return this for chaining
*/
- public GroupingLooseResolver<GROUPING> add(Class<? extends Augmentation<?>> cls) {
+ public GroupingLooseResolver<G> add(Class<? extends Augmentation<?>> cls) {
Preconditions.checkArgument(commonInterface.isAssignableFrom(cls),
"oh man! I got " + cls);
classes.add(cls);
* @return shared grouping
*/
@SuppressWarnings("unchecked")
- public <T extends Augmentable<T>> Optional<GROUPING> getExtension(DataObject data) {
+ public <T extends Augmentable<T>> Optional<G> getExtension(DataObject data) {
T guessData = (T) data;
for (Class<? extends Augmentation<?>> cls : classes) {
Augmentation<T> potential = guessData
.getAugmentation((Class<Augmentation<T>>) cls);
if (potential != null) {
- return Optional.of((GROUPING) potential);
+ return Optional.of((G) potential);
}
}
* multiple {@link Augmentation}s depending on origin. And those {@link Augmentation}s
* are sharing the same grouping so that they could be processed in the same way.
*
- * @param <GROUPING>
+ * @param <G> grouping
* @param <T>
*/
-public class GroupingResolver<GROUPING, T extends Augmentable<T>> {
+public class GroupingResolver<G, T extends Augmentable<T>> {
- Class<GROUPING> commonInterface;
+ Class<G> commonInterface;
Set<Class<? extends Augmentation<T>>> classes;
/**
* @param commonInterface
*/
- public GroupingResolver(Class<GROUPING> commonInterface) {
+ public GroupingResolver(Class<G> commonInterface) {
this.commonInterface = commonInterface;
classes = new HashSet<>();
}
* @param cls equivalent augmentation class
* @return this for chaining
*/
- public <X extends Augmentation<T>> GroupingResolver<GROUPING, T> add(Class<X> cls) {
+ public <X extends Augmentation<T>> GroupingResolver<G, T> add(Class<X> cls) {
Preconditions.checkArgument(commonInterface.isAssignableFrom(cls));
classes.add(cls);
return this;
* @return shared grouping
*/
@SuppressWarnings("unchecked")
- public Optional<GROUPING> getExtension(T data) {
+ public Optional<G> getExtension(T data) {
for (Class<? extends Augmentation<T>> cls : classes) {
Augmentation<T> potential = data.getAugmentation(cls);
if (potential != null) {
- return Optional.of((GROUPING) potential);
+ return Optional.of((G) potential);
}
}
return Optional.absent();
* lookup and register key for extension converters, basic case expects this to
* correlate with input model type
*
- * @param <TYPE> type of key
+ * @param <T> type of key
*/
-public class TypeVersionKey<TYPE> {
+public class TypeVersionKey<T> {
- private Class<? extends TYPE> type;
+ private Class<? extends T> type;
private short ofVersion;
/**
* @param type
* @param ofVersion
*/
- public TypeVersionKey(Class<? extends TYPE> type, short ofVersion) {
+ public TypeVersionKey(Class<? extends T> type, short ofVersion) {
this.type = type;
this.ofVersion = ofVersion;
}
/**
* @return key type
*/
- public Class<? extends TYPE> getType() {
+ public Class<? extends T> getType() {
return type;
}
@Override
public boolean equals(Object obj) {
- if (this == obj)
+ if (this == obj) {
return true;
- if (obj == null)
+ }
+ if (obj == null) {
return false;
- if (getClass() != obj.getClass())
+ }
+ if (getClass() != obj.getClass()) {
return false;
+ }
TypeVersionKey<?> other = (TypeVersionKey<?>) obj;
- if (ofVersion != other.ofVersion)
+ if (ofVersion != other.ofVersion) {
return false;
+ }
if (type == null) {
if (other.type != null)
return false;
* @param key
* @return found converter
*/
- <FROM extends DataContainer, PATH extends AugmentationPath> ConvertorFromOFJava<FROM, PATH> getConverter(MessageTypeKey<?> key);
+ <F extends DataContainer, P extends AugmentationPath> ConvertorFromOFJava<F, P> getConverter(MessageTypeKey<?> key);
/**
* lookup converter
* @param key
* @return found converter
*/
- <TO extends DataContainer> ConvertorToOFJava<TO> getConverter(ConverterExtensionKey<?> key);
+ <T extends DataContainer> ConvertorToOFJava<T> getConverter(ConverterExtensionKey<?> key);
/**
* @param key
* @return found converter
*/
- <FROM extends Action, TO extends DataContainer> ConvertorActionToOFJava<FROM, TO> getConverter(TypeVersionKey<FROM> key);
+ <F extends Action, T extends DataContainer> ConvertorActionToOFJava<F, T> getConverter(TypeVersionKey<F> key);
/**
* lookup converter<br/>
* @param key
* @return found converter
*/
- <FROM extends DataContainer, PATH extends AugmentationPath> ConvertorActionFromOFJava<FROM, PATH> getActionConverter(MessageTypeKey<?> key);
+ <F extends DataContainer, P extends AugmentationPath> ConvertorActionFromOFJava<F, P> getActionConverter(MessageTypeKey<?> key);
}