private static <T> T getTypeModifier(final SchemaSource schema, final ModifierType modifierType, final T defaultValue) { for (SchemaSource.Entry entry : schema.getRelated(TypeDefinitionCategory.TYPE_MODIFIER, Direction.OUT)) { T value = entry.getSchemaType().getDefinition().getValue(modifierType.getCategory()); if (null != value) { return value; } } return defaultValue; }
Preconditions.checkArgument(element != null, "null schema element"); TypeDefinitionCategory cat = modifierType.getCategory(); Object existingValue = def.getValue(modifierType.getCategory()); if (null != existingValue) { if (existingValue.equals(value)) {
private static <T> T getTypeModifier(final SchemaSource schema, final ModifierType modifierType, final T defaultValue) { for (SchemaSource.Entry entry : schema.getRelated(TypeDefinitionCategory.TYPE_MODIFIER, Direction.OUT)) { T value = entry.getSchemaType().getDefinition().getValue(modifierType.getCategory()); if (null != value) { return value; } } return defaultValue; }
private static <T> T getTypeModifier(final SchemaSource schema, final ModifierType modifierType, final T defaultValue) { for (SchemaSource.Entry entry : schema.getRelated(TypeDefinitionCategory.TYPE_MODIFIER, Direction.OUT)) { T value = entry.getSchemaType().getDefinition().getValue(modifierType.getCategory()); if (null != value) { return value; } } return defaultValue; }
Preconditions.checkArgument(value != null, "null value for type modifier " + modifierType); TypeDefinitionCategory cat = modifierType.getCategory(); if (cat.hasDataType()) { Preconditions.checkArgument(cat.getDataType().equals(value.getClass()), "modifier value is not of expected type " + cat.getDataType()); Object existingValue = def.getValue(modifierType.getCategory()); if (null != existingValue) { if (existingValue.equals(value)) {
Preconditions.checkArgument(element != null, "null schema element"); TypeDefinitionCategory cat = modifierType.getCategory(); Object existingValue = def.getValue(modifierType.getCategory()); if (null != existingValue) { if (existingValue.equals(value)) {