/** * Gets a read-only view of the DIM Fields * @return */ public Set<TagValue> getDIMFields(){ return SetUtils.unmodifiableSet(this.nDIMFields); }
/** * @return a Read-only view of the Modalities. */ public Set<String> getModalities() { return SetUtils.unmodifiableSet(modalitiesSet); }
/** * @return a Read only view of the Private Fields */ public Set<TagValue> getPrivateFields(){ return SetUtils.unmodifiableSet(nPrivateFields); }
/** * @return a Read-only view of all fields. */ public Set<TagValue> getAllFields(){ return SetUtils.unmodifiableSet( new HashSet<>(tagValueMappings.values()) ); }
public ArgumentsMetadata(Iterable<ArgumentsMetadata> arguments) { if (arguments == null) throw new NullPointerException("arguments cannot be null"); if (!arguments.iterator().hasNext()) throw new IllegalArgumentException("arguments cannot be empty"); ArgumentsMetadata first = arguments.iterator().next(); this.titles = first.titles; this.description = first.description; this.restrictions = first.restrictions; this.provider = first.provider; Set<Accessor> accessors = new HashSet<>(); for (ArgumentsMetadata other : arguments) { if (!first.equals(other)) throw new IllegalArgumentException( String.format("Conflicting arguments definitions: %s, %s", first, other)); accessors.addAll(other.getAccessors()); } this.accessors = SetUtils.unmodifiableSet(accessors); }
public OptionMetadata(Iterable<OptionMetadata> options) { if (options == null) throw new NullPointerException("options cannot be null"); if (!options.iterator().hasNext()) throw new IllegalArgumentException("options cannot be empty"); OptionMetadata option = options.iterator().next(); this.optionType = option.optionType; this.options = option.options; this.title = option.title; this.description = option.description; this.arity = option.arity; this.hidden = option.hidden; this.overrides = option.overrides; this.sealed = option.sealed; this.restrictions = option.restrictions; this.provider = option.provider; Set<Accessor> accessors = new LinkedHashSet<Accessor>(); for (OptionMetadata other : options) { if (!option.equals(other)) throw new IllegalArgumentException( String.format("Duplicate options definitions: %s, %s", option, other)); accessors.addAll(other.getAccessors()); } this.accessors = SetUtils.unmodifiableSet(accessors); }
public ArgumentsMetadata(Iterable<String> titles, String description, Iterable<ArgumentsRestriction> restrictions, TypeConverterProvider typeConverterProvider, Iterable<Field> path) { //@formatter:on if (titles == null) throw new NullPointerException("title cannot be null"); if (path == null) throw new NullPointerException("path cannot be null"); if (!path.iterator().hasNext()) throw new IllegalArgumentException("path cannot be empty"); this.titles = ListUtils.unmodifiableList(IteratorUtils.toList(titles.iterator())); this.description = description; this.restrictions = restrictions != null ? AirlineUtils.unmodifiableListCopy(restrictions) : Collections.<ArgumentsRestriction> emptyList(); this.provider = typeConverterProvider != null ? typeConverterProvider : new DefaultTypeConverterProvider(); this.accessors = SetUtils.unmodifiableSet(Collections.singleton(new Accessor(path))); }
this.accessors = SetUtils.unmodifiableSet(Collections.singleton(new Accessor(path)));