/** * {@inheritDoc} * * Note: If the descriptor with {@code key} does not exist in this set, the call is delegated to the base descriptors. */ @Nullable @Override public Value getValue(@NotNull String key) { Descriptor d = descriptors.get(key); if (d == null) { return base == null ? null : base.getValue(key); } return !d.singleValued ? null : d.values[0]; }
/** * {@inheritDoc} * * Note: If the descriptor with {@code key} does not exist in this set, the call is delegated to the base descriptors. */ @Nullable @Override public Value[] getValues(@NotNull String key) { Descriptor d = descriptors.get(key); if (d == null) { return base == null ? null : base.getValues(key); } return d.values; }
/** * {@inheritDoc} * * Note: If the descriptor with {@code key} does not exist in this set, the call is delegated to the base descriptors. */ @Override public boolean isSingleValueDescriptor(@NotNull String key) { return descriptors.containsKey(key) && descriptors.get(key).singleValued || base != null && base.isSingleValueDescriptor(key); }
static DescriptorEntry fromKey(String key, Descriptors descriptors) { if (descriptors.isSingleValueDescriptor(key)) { return newSingleValuedEntry(key, descriptors.getValue(key), descriptors.isStandardDescriptor(key)); } else { return newMultiValuedEntry(key, descriptors.getValues(key), descriptors.isStandardDescriptor(key)); } }
/** * {@inheritDoc} * * Note: If the descriptor with {@code key} does not exist in this set, the call is delegated to the base descriptors. */ @Override public boolean isStandardDescriptor(@NotNull String key) { return descriptors.containsKey(key) && descriptors.get(key).standard || base != null && base.isStandardDescriptor(key); }
/** * {@inheritDoc} * * Note: If this descriptors are based on default descriptors, the returns string array is a merge of this and the * base's keys. */ @NotNull @Override public String[] getKeys() { Set<String> keys = new HashSet<String>(descriptors.keySet()); if (base != null) { Collections.addAll(keys, base.getKeys()); } return keys.toArray(new String[keys.size()]); }
/** * {@inheritDoc} * * Note: If the descriptor with {@code key} does not exist in this set, the call is delegated to the base descriptors. */ @Override public boolean isStandardDescriptor(@Nonnull String key) { return descriptors.containsKey(key) && descriptors.get(key).standard || base != null && base.isStandardDescriptor(key); }
/** * {@inheritDoc} * * Note: If this descriptors are based on default descriptors, the returns string array is a merge of this and the * base's keys. */ @Nonnull @Override public String[] getKeys() { Set<String> keys = new HashSet<String>(descriptors.keySet()); if (base != null) { Collections.addAll(keys, base.getKeys()); } return keys.toArray(new String[keys.size()]); }
/** * {@inheritDoc} * * Note: If the descriptor with {@code key} does not exist in this set, the call is delegated to the base descriptors. */ @CheckForNull @Override public Value getValue(@Nonnull String key) { Descriptor d = descriptors.get(key); if (d == null) { return base == null ? null : base.getValue(key); } return !d.singleValued ? null : d.values[0]; }
@Override public boolean isStandardDescriptor(@NotNull String key) { for (Iterator<Descriptors> it = getDescriptors().iterator(); it.hasNext();) { Descriptors descriptors = it.next(); if (descriptors.isStandardDescriptor(key)) { return true; } } return false; }
/** * {@inheritDoc} * * Note: If the descriptor with {@code key} does not exist in this set, the call is delegated to the base descriptors. */ @Override public boolean isSingleValueDescriptor(@Nonnull String key) { return descriptors.containsKey(key) && descriptors.get(key).singleValued || base != null && base.isSingleValueDescriptor(key); }
/** * {@inheritDoc} * * Note: If the descriptor with {@code key} does not exist in this set, the call is delegated to the base descriptors. */ @CheckForNull @Override public Value[] getValues(@Nonnull String key) { Descriptor d = descriptors.get(key); if (d == null) { return base == null ? null : base.getValues(key); } return d.values; }
@Override public String[] getKeys() { Set<String> keys = new HashSet<String>(); for (Iterator<Descriptors> it = getDescriptors().iterator(); it.hasNext();) { Descriptors descriptors = it.next(); Collections.addAll(keys, descriptors.getKeys()); } return keys.toArray(new String[keys.size()]); }
@CheckForNull @Override public Value getValue(@Nonnull String key) { for (Iterator<Descriptors> it = getDescriptors().iterator(); it.hasNext();) { Descriptors descriptors = it.next(); Value value = descriptors.getValue(key); if (value!=null) { return value; } } return null; }
@Override public boolean isStandardDescriptor(@Nonnull String key) { for (Iterator<Descriptors> it = getDescriptors().iterator(); it.hasNext();) { Descriptors descriptors = it.next(); if (descriptors.isStandardDescriptor(key)) { return true; } } return false; }
@Override public boolean isSingleValueDescriptor(@Nonnull String key) { for (Iterator<Descriptors> it = getDescriptors().iterator(); it.hasNext();) { Descriptors descriptors = it.next(); if (descriptors.isSingleValueDescriptor(key)) { return true; } } return false; }
@Nullable @Override public Value[] getValues(@NotNull String key) { for (Iterator<Descriptors> it = getDescriptors().iterator(); it.hasNext();) { Descriptors descriptors = it.next(); Value[] values = descriptors.getValues(key); if (values!=null) { return values; } } return null; }
@Override public String[] getKeys() { Set<String> keys = new HashSet<String>(); for (Iterator<Descriptors> it = getDescriptors().iterator(); it.hasNext();) { Descriptors descriptors = it.next(); Collections.addAll(keys, descriptors.getKeys()); } return keys.toArray(new String[keys.size()]); }
@Nullable @Override public Value getValue(@NotNull String key) { for (Iterator<Descriptors> it = getDescriptors().iterator(); it.hasNext();) { Descriptors descriptors = it.next(); Value value = descriptors.getValue(key); if (value!=null) { return value; } } return null; }
@Override public boolean isSingleValueDescriptor(@NotNull String key) { for (Iterator<Descriptors> it = getDescriptors().iterator(); it.hasNext();) { Descriptors descriptors = it.next(); if (descriptors.isSingleValueDescriptor(key)) { return true; } } return false; }