/**
* Scans supplied class and returns an iterable of all data children classes.
*
- * @param type
- * YANG Modeled Entity derived from DataContainer
+ * @param type YANG Modeled Entity derived from DataContainer
* @return Iterable of all data children, which have YANG modeled entity
*/
- public static Map<Class<?>, Method> getChildrenClassToMethod(final Class<?> type) {
- return getChildrenClassToMethod(type, BindingMapping.GETTER_PREFIX);
+ public static Map<Class<? extends DataContainer>, Method> getChildrenClassToMethod(final Class<?> type) {
+ return getChildClassToMethod(type, BindingMapping.GETTER_PREFIX);
+ }
+
+ @Beta
+ public static Map<Class<? extends DataContainer>, Method> getChildrenClassToNonnullMethod(final Class<?> type) {
+ return getChildClassToMethod(type, BindingMapping.NONNULL_PREFIX);
}
- private static Map<Class<?>, Method> getChildrenClassToMethod(final Class<?> type, final String prefix) {
+ private static Map<Class<? extends DataContainer>, Method> getChildClassToMethod(final Class<?> type,
+ final String prefix) {
checkArgument(type != null, "Target type must not be null");
checkArgument(DataContainer.class.isAssignableFrom(type), "Supplied type %s must be derived from DataContainer",
type);
- Map<Class<?>, Method> ret = new HashMap<>();
+ Map<Class<? extends DataContainer>, Method> ret = new HashMap<>();
for (Method method : type.getMethods()) {
Optional<Class<? extends DataContainer>> entity = getYangModeledReturnType(method, prefix);
if (entity.isPresent()) {
return ret;
}
- @Beta
- public static Map<Class<?>, Method> getChildrenClassToNonnullMethod(final Class<?> type) {
- return getChildrenClassToMethod(type, BindingMapping.NONNULL_PREFIX);
- }
-
private static Optional<Class<? extends DataContainer>> getYangModeledReturnType(final Method method,
final String prefix) {
final String methodName = method.getName();
}
}
- /**
- * Extracts augmentation from Binding DTO field using reflection.
- *
- * @param input Instance of DataObject which is augmentable and may contain augmentation
- * @return Map of augmentations if read was successful, otherwise empty map.
- * @deprecated Use {@link Augmentable#augmentations()} instead.
- */
- @SuppressWarnings("unchecked")
- @Deprecated(forRemoval = true)
- public static Map<Class<? extends Augmentation<?>>, Augmentation<?>> getAugmentations(final Augmentable<?> input) {
- return (Map) input.augmentations();
- }
-
/**
* Determines if two augmentation classes or case classes represents same
* data.