org.wildfly.security.authz.Attributes.remove()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中org.wildfly.security.authz.Attributes.remove()方法的一些代码示例,展示了Attributes.remove()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Attributes.remove()方法的具体详情如下:
包路径:org.wildfly.security.authz.Attributes
类名称:Attributes
方法名:remove

Attributes.remove介绍

[英]Remove all values for the given key from this collection.
[中]从此集合中删除给定键的所有值。

代码示例

代码示例来源:origin: wildfly/wildfly

/**
 * Remove the first value mapped to the given key.
 *
 * @param key the key
 * @return the value
 * @throws IndexOutOfBoundsException if there are no values for the given key
 */
default String removeFirst(String key) {
  return remove(key, 0);
}

代码示例来源:origin: wildfly/wildfly

public boolean remove(final Object o) {
  return o instanceof String && Attributes.this.remove((String) o);
}

代码示例来源:origin: wildfly/wildfly

/**
 * Remove all the values for the given key between the {@code from} index (inclusive) and the {@code to} index
 * (exclusive).
 *
 * @param key the key
 * @param from the start index (inclusive)
 * @param to the end index (exclusive)
 * @throws IndexOutOfBoundsException if {@code idx} is less than 0 or greater than or equal to {@code size(key)}
 */
default void removeRange(String key, int from, int to) {
  for (int i = to - 1; i >= from; i --) {
    remove(key, i);
  }
}

代码示例来源:origin: wildfly/wildfly

public String remove(final int index) {
  return attributes.remove(key, index);
}

代码示例来源:origin: wildfly/wildfly

public void clear() {
  attributes.remove(key);
}

代码示例来源:origin: wildfly/wildfly

/**
 * Remove the first occurrence of the given value under the given key, if any.
 *
 * @param key the key
 * @param value the value to remove
 * @return {@code true} if the value was found and removed, {@code false} otherwise
 */
default boolean removeFirst(String key, String value) {
  final int idx = indexOf(key, value);
  return idx >= 0 && remove(key, idx, value);
}

代码示例来源:origin: wildfly/wildfly

/**
 * Remove the last value mapped to the given key.
 *
 * @param key the key
 * @return the value
 * @throws IndexOutOfBoundsException if there are no values for the given key
 */
default String removeLast(String key) {
  return remove(key, size(key) - 1);
}

代码示例来源:origin: wildfly/wildfly

/**
 * Remove the last occurrence of the given value under the given key, if any.
 *
 * @param key the key
 * @param value the value to remove
 * @return {@code true} if the value was found and removed, {@code false} otherwise
 */
default boolean removeLast(String key, String value) {
  final int idx = lastIndexOf(key, value);
  return idx >= 0 && remove(key, idx, value);
}

代码示例来源:origin: wildfly/wildfly

/**
 * Remove the mapping for the given key at the given position if it matches the given existing value.  All later
 * entries for that key are shifted up to fill in the gap left by the removed element.
 *
 * @param key the key
 * @param idx the index
 * @param value the expected previous mapping value
 * @return {@code true} if the value matched and was removed, {@code false} otherwise
 * @throws IndexOutOfBoundsException if {@code idx} is less than 0 or greater than or equal to {@code size(key)}
 */
default boolean remove(String key, int idx, String value) {
  if (get(key, idx).equals(value)) {
    remove(key, idx);
    return true;
  } else {
    return false;
  }
}

代码示例来源:origin: wildfly/wildfly

/**
 * Remove all values for the given key from this collection, copying the values into a list which is returned.
 *
 * @param key the key
 * @return the values as a list (not {@code null})
 */
default List<String> copyAndRemove(String key) {
  final Entry values = get(key);
  List<String> copy = values.isEmpty() ? Collections.emptyList() : new ArrayList<>(values);
  remove(key);
  return copy;
}

代码示例来源:origin: wildfly/wildfly

/**
 * Remove the all occurrences of the given value under the given key, if any.
 *
 * @param key the key
 * @param value the value to remove
 * @return {@code true} if the value was found and removed, {@code false} otherwise
 */
default boolean removeAll(String key, String value) {
  int idx = lastIndexOf(key, value);
  if (idx == -1) return false;
  while (idx >= 0) {
    remove(key, idx, value);
    idx = lastIndexOf(key, value);
  }
  return true;
}

代码示例来源:origin: org.wildfly.security/wildfly-elytron

/**
 * Remove the first value mapped to the given key.
 *
 * @param key the key
 * @return the value
 * @throws IndexOutOfBoundsException if there are no values for the given key
 */
default String removeFirst(String key) {
  return remove(key, 0);
}

代码示例来源:origin: org.wildfly.security/wildfly-elytron-auth-server

/**
 * Remove the last value mapped to the given key.
 *
 * @param key the key
 * @return the value
 * @throws IndexOutOfBoundsException if there are no values for the given key
 */
default String removeLast(String key) {
  return remove(key, size(key) - 1);
}

代码示例来源:origin: org.wildfly.security/wildfly-elytron-auth-server

/**
 * Remove the last occurrence of the given value under the given key, if any.
 *
 * @param key the key
 * @param value the value to remove
 * @return {@code true} if the value was found and removed, {@code false} otherwise
 */
default boolean removeLast(String key, String value) {
  final int idx = lastIndexOf(key, value);
  return idx >= 0 && remove(key, idx, value);
}

代码示例来源:origin: org.wildfly.security/wildfly-elytron

/**
 * Remove the first occurrence of the given value under the given key, if any.
 *
 * @param key the key
 * @param value the value to remove
 * @return {@code true} if the value was found and removed, {@code false} otherwise
 */
default boolean removeFirst(String key, String value) {
  final int idx = indexOf(key, value);
  return idx >= 0 && remove(key, idx, value);
}

代码示例来源:origin: org.wildfly.security/wildfly-elytron

/**
 * Remove the last occurrence of the given value under the given key, if any.
 *
 * @param key the key
 * @param value the value to remove
 * @return {@code true} if the value was found and removed, {@code false} otherwise
 */
default boolean removeLast(String key, String value) {
  final int idx = lastIndexOf(key, value);
  return idx >= 0 && remove(key, idx, value);
}

代码示例来源:origin: org.wildfly.security/wildfly-elytron

/**
 * Remove the last value mapped to the given key.
 *
 * @param key the key
 * @return the value
 * @throws IndexOutOfBoundsException if there are no values for the given key
 */
default String removeLast(String key) {
  return remove(key, size(key) - 1);
}

代码示例来源:origin: org.wildfly.security/wildfly-elytron-auth-server

/**
 * Remove all values for the given key from this collection, copying the values into a list which is returned.
 *
 * @param key the key
 * @return the values as a list (not {@code null})
 */
default List<String> copyAndRemove(String key) {
  final Entry values = get(key);
  List<String> copy = values.isEmpty() ? Collections.emptyList() : new ArrayList<>(values);
  remove(key);
  return copy;
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

/**
 * Remove all values for the given key from this collection, copying the values into a list which is returned.
 *
 * @param key the key
 * @return the values as a list (not {@code null})
 */
default List<String> copyAndRemove(String key) {
  final Entry values = get(key);
  List<String> copy = values.isEmpty() ? Collections.emptyList() : new ArrayList<>(values);
  remove(key);
  return copy;
}

代码示例来源:origin: org.wildfly.security/wildfly-elytron

/**
 * Remove all values for the given key from this collection, copying the values into a list which is returned.
 *
 * @param key the key
 * @return the values as a list (not {@code null})
 */
default List<String> copyAndRemove(String key) {
  final Entry values = get(key);
  List<String> copy = values.isEmpty() ? Collections.emptyList() : new ArrayList<>(values);
  remove(key);
  return copy;
}

相关文章