org.apache.openjpa.lib.conf.Value.isDynamic()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(80)

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

Value.isDynamic介绍

[英]Affirms if this receiver can be mutated even when the configuration it belongs to has been Configuration#isReadOnly().
[中]确认即使该接收器所属的配置为configuration#isReadOnly(),该接收器是否可以变异。

代码示例

代码示例来源:origin: org.apache.openjpa/openjpa-all

/**
 * Use {@link #getOriginalValue() original value} instead of 
 * {@link #getString() current value} because they are one and the same 
 * for non-dynamic Values and ensures that modifying dynamic Values do not
 * impact equality or hashCode contract.   
 */
public int hashCode() {
  String str = (isDynamic()) ? getOriginalValue() : getString();
  int strHash = (str == null) ? 0 : str.hashCode();
  int propHash = (prop == null) ? 0 : prop.hashCode();
  return strHash ^ propHash;
}

代码示例来源:origin: org.apache.openejb.patch/openjpa

/**
 * Use {@link #getOriginalValue() original value} instead of 
 * {@link #getString() current value} because they are one and the same 
 * for non-dynamic Values and ensures that modifying dynamic Values do not
 * impact equality or hashCode contract.   
 */
public int hashCode() {
  String str = (isDynamic()) ? getOriginalValue() : getString();
  int strHash = (str == null) ? 0 : str.hashCode();
  int propHash = (prop == null) ? 0 : prop.hashCode();
  return strHash ^ propHash;
}

代码示例来源:origin: org.apache.openjpa/openjpa-lib

/**
 * Use {@link #getOriginalValue() original value} instead of 
 * {@link #getString() current value} because they are one and the same 
 * for non-dynamic Values and ensures that modifying dynamic Values do not
 * impact equality or hashCode contract.   
 */
public int hashCode() {
  String str = (isDynamic()) ? getOriginalValue() : getString();
  int strHash = (str == null) ? 0 : str.hashCode();
  int propHash = (prop == null) ? 0 : prop.hashCode();
  return strHash ^ propHash;
}

代码示例来源:origin: org.apache.openjpa/com.springsource.org.apache.openjpa

/**
 * Use {@link #getOriginalValue() original value} instead of 
 * {@link #getString() current value} because they are one and the same 
 * for non-dynamic Values and ensures that modifying dynamic Values do not
 * impact equality or hashCode contract.   
 */
public int hashCode() {
  String str = (isDynamic()) ? getOriginalValue() : getString();
  int strHash = (str == null) ? 0 : str.hashCode();
  int propHash = (prop == null) ? 0 : prop.hashCode();
  return strHash ^ propHash;
}

代码示例来源:origin: org.apache.openjpa/openjpa-all

/**
 * Use {@link #getOriginalValue() original value} instead of 
 * {@link #getString() current value} because they are one and the same 
 * for non-dynamic Values and ensures that modifying dynamic Values do not
 * impact equality or hashCode contract.   
 */
public boolean equals(Object other) {
  if (other == this)
    return true;
  if (!(other instanceof Value))
    return false;
  Value o = (Value) other;
  String thisStr = (isDynamic()) ? getOriginalValue() : getString();
  String thatStr = (isDynamic()) ? o.getOriginalValue() : o.getString();
  return (isDynamic() == o.isDynamic())
    && Objects.equals(prop, o.getProperty())
    && Objects.equals(thisStr, thatStr);
}

代码示例来源:origin: org.apache.openjpa/com.springsource.org.apache.openjpa

/**
 * Use {@link #getOriginalValue() original value} instead of 
 * {@link #getString() current value} because they are one and the same 
 * for non-dynamic Values and ensures that modifying dynamic Values do not
 * impact equality or hashCode contract.   
 */
public boolean equals(Object other) {
  if (other == this)
    return true;
  if (!(other instanceof Value))
    return false;
  Value o = (Value) other;
  String thisStr = (isDynamic()) ? getOriginalValue() : getString();
  String thatStr = (isDynamic()) ? o.getOriginalValue() : o.getString();
  return (isDynamic() == o.isDynamic())
    && StringUtils.equals(prop, o.getProperty())
    && StringUtils.equals(thisStr, thatStr);
}

代码示例来源:origin: org.apache.openjpa/openjpa-lib

/**
 * Use {@link #getOriginalValue() original value} instead of 
 * {@link #getString() current value} because they are one and the same 
 * for non-dynamic Values and ensures that modifying dynamic Values do not
 * impact equality or hashCode contract.   
 */
public boolean equals(Object other) {
  if (other == this)
    return true;
  if (!(other instanceof Value))
    return false;
  Value o = (Value) other;
  String thisStr = (isDynamic()) ? getOriginalValue() : getString();
  String thatStr = (isDynamic()) ? o.getOriginalValue() : o.getString();
  return (isDynamic() == o.isDynamic())
    && Objects.equals(prop, o.getProperty())
    && Objects.equals(thisStr, thatStr);
}

代码示例来源:origin: org.apache.openejb.patch/openjpa

/**
 * Use {@link #getOriginalValue() original value} instead of 
 * {@link #getString() current value} because they are one and the same 
 * for non-dynamic Values and ensures that modifying dynamic Values do not
 * impact equality or hashCode contract.   
 */
public boolean equals(Object other) {
  if (other == this)
    return true;
  if (!(other instanceof Value))
    return false;
  Value o = (Value) other;
  String thisStr = (isDynamic()) ? getOriginalValue() : getString();
  String thatStr = (isDynamic()) ? o.getOriginalValue() : o.getString();
  return (isDynamic() == o.isDynamic())
    && StringUtils.equals(prop, o.getProperty())
    && StringUtils.equals(thisStr, thatStr);
}

代码示例来源:origin: org.apache.openjpa/openjpa-all

/**
 * Asserts if this receiver can be changed.
 * Subclasses <em>must</em> invoke this method before changing its
 * internal state.
 * 
 * This receiver can not be changed if all of the following is true
 * <LI>this receiver is not dynamic
 * <LI>ValueListener attached to this receiver is a Configuration
 * <LI>Configuration is read-only
 */
protected void assertChangeable() {
  if (!isDynamic() && containsReadOnlyConfigurationAsListener()) {
    throw new RuntimeException(s_loc.get("veto-change",
      this.getProperty()).toString());
    }
}

代码示例来源:origin: org.apache.openjpa/openjpa-lib

/**
 * Asserts if this receiver can be changed.
 * Subclasses <em>must</em> invoke this method before changing its
 * internal state.
 * 
 * This receiver can not be changed if all of the following is true
 * <LI>this receiver is not dynamic
 * <LI>ValueListener attached to this receiver is a Configuration
 * <LI>Configuration is read-only
 */
protected void assertChangeable() {
  if (!isDynamic() && containsReadOnlyConfigurationAsListener()) {
    throw new RuntimeException(s_loc.get("veto-change",
      this.getProperty()).toString());
    }
}

代码示例来源:origin: org.apache.openejb.patch/openjpa

/**
 * Asserts if this receiver can be changed.
 * Subclasses <em>must</em> invoke this method before changing its
 * internal state.
 * 
 * This receiver can not be changed if all of the following is true
 * <LI>this receiver is not dynamic
 * <LI>ValueListener attached to this receiver is a Configuration
 * <LI>Configuration is read-only
 */
protected void assertChangeable() {
  if (!isDynamic() && containsReadOnlyConfigurationAsListener()) {
    throw new RuntimeException(s_loc.get("veto-change",
      this.getProperty()).toString());
    }
}

代码示例来源:origin: org.apache.openjpa/com.springsource.org.apache.openjpa

/**
 * Asserts if this receiver can be changed.
 * Subclasses <em>must</em> invoke this method before changing its
 * internal state.
 * 
 * This receiver can not be changed if all of the following is true
 * <LI>this receiver is not dynamic
 * <LI>ValueListener attached to this receiver is a Configuration
 * <LI>Configuration is read-only
 */
protected void assertChangeable() {
  if (!isDynamic() && listen instanceof Configuration && 
    ((Configuration)listen).isReadOnly()) {
    throw new RuntimeException(s_loc.get("veto-change",
      this.getProperty()).toString());
    }
}

相关文章