类 AttributeAccessorSupport
java.lang.Object
cn.taketoday.core.AttributeAccessorSupport
- 所有已实现的接口:
AttributeAccessor,Serializable
public abstract class AttributeAccessorSupport
extends Object
implements AttributeAccessor, Serializable
Support class for
AttributeAccessors, providing a
base implementation of all methods. To be extended by subclasses.
Serializable if subclasses and all attribute values are
Serializable.
- 从以下版本开始:
- 2.1.7
- 作者:
- Rob Harrop, Juergen Hoeller, TODAY
2020-02-22 12:47 - 另请参阅:
-
字段概要
字段修饰符和类型字段说明Map with String keys and Object values.private static final long -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Return the names Iterator.void<T> TcomputeAttribute(String name, Function<String, T> computeFunction) Compute a new value for the attribute identified bynameif necessary and set the new value in thisAttributeAccessor.voidcopyAttributesFrom(AttributeAccessor source) Copy the attributes from the supplied AttributeAccessor to this accessor.booleangetAttribute(String name) Get the value of the attribute identified byname.String[]Return the names of all attributes.Return attributes mapbooleanhasAttribute(String name) Returntrueif the attribute identified bynameexists.booleanReturnstrueif this map contains no key-value mappings.inthashCode()removeAttribute(String name) Remove the attribute identified bynameand return its value.voidsetAttribute(String name, Object value) Set the attribute defined bynameto the suppliedvalue.
-
字段详细资料
-
serialVersionUID
private static final long serialVersionUID- 另请参阅:
-
attributes
Map with String keys and Object values.
-
-
构造器详细资料
-
AttributeAccessorSupport
public AttributeAccessorSupport()
-
-
方法详细资料
-
setAttribute
从接口复制的说明:AttributeAccessorSet the attribute defined bynameto the suppliedvalue. Ifvalueisnull, the attribute isremoved.In general, users should take care to prevent overlaps with other metadata attributes by using fully-qualified names, perhaps using class or package names as prefix.
- 指定者:
setAttribute在接口中AttributeAccessor- 参数:
name- the unique attribute keyvalue- the attribute value to be attached
-
getAttribute
从接口复制的说明:AttributeAccessorGet the value of the attribute identified byname. Returnnullif the attribute doesn't exist.- 指定者:
getAttribute在接口中AttributeAccessor- 参数:
name- the unique attribute key- 返回:
- the current value of the attribute, if any
-
computeAttribute
从接口复制的说明:AttributeAccessorCompute a new value for the attribute identified bynameif necessary and set the new value in thisAttributeAccessor.If a value for the attribute identified by
namealready exists in thisAttributeAccessor, the existing value will be returned without applying the supplied compute function.The default implementation of this method is not thread safe but can overridden by concrete implementations of this interface.
- 指定者:
computeAttribute在接口中AttributeAccessor- 类型参数:
T- the type of the attribute value- 参数:
name- the unique attribute keycomputeFunction- a function that computes a new value for the attribute name; the function must not return anullvalue- 返回:
- the existing value or newly computed value for the named attribute
- 另请参阅:
-
removeAttribute
从接口复制的说明:AttributeAccessorRemove the attribute identified bynameand return its value. Returnnullif no attribute undernameis found.- 指定者:
removeAttribute在接口中AttributeAccessor- 参数:
name- the unique attribute key- 返回:
- the last value of the attribute, if any
-
hasAttribute
从接口复制的说明:AttributeAccessorReturntrueif the attribute identified bynameexists. Otherwise returnfalse.- 指定者:
hasAttribute在接口中AttributeAccessor- 参数:
name- the unique attribute key
-
getAttributeNames
从接口复制的说明:AttributeAccessorReturn the names of all attributes.- 指定者:
getAttributeNames在接口中AttributeAccessor
-
attributeNames
从接口复制的说明:AttributeAccessorReturn the names Iterator.- 指定者:
attributeNames在接口中AttributeAccessor
-
copyAttributesFrom
Copy the attributes from the supplied AttributeAccessor to this accessor.- 指定者:
copyAttributesFrom在接口中AttributeAccessor- 参数:
source- the AttributeAccessor to copy from
-
clearAttributes
public void clearAttributes()- 指定者:
clearAttributes在接口中AttributeAccessor- 从以下版本开始:
- 3.0
-
hasAttributes
public boolean hasAttributes()Returnstrueif this map contains no key-value mappings.- 指定者:
hasAttributes在接口中AttributeAccessor- 返回:
trueif this map contains no key-value mappings- 从以下版本开始:
- 4.0
-
hashCode
public int hashCode() -
equals
-
getAttributes
从接口复制的说明:AttributeAccessorReturn attributes map- 指定者:
getAttributes在接口中AttributeAccessor- 返回:
- attributes map
-
createAttributes
-