com.fasterxml.jackson.module.jsonSchema.JsonSchema.equals()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(122)

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

JsonSchema.equals介绍

[英]A utility method allowing to easily chain calls to equals() on members without taking any risk regarding the ternary operator precedence.
[中]一种实用方法,允许在成员上轻松链接对equals()的调用,而不必冒任何三元运算符优先级的风险。

代码示例

代码示例来源:origin: com.fasterxml.jackson.module/jackson-module-jsonSchema

  1. protected static <T> boolean arraysEqual(T[] arr1, T[] arr2) {
  2. if (arr1 == null) {
  3. return arr2 == null;
  4. }
  5. if (arr2 == null) {
  6. return false;
  7. }
  8. int len = arr1.length;
  9. if (len != arr2.length) {
  10. return false;
  11. }
  12. for (int i = 0; i < len; ++i) {
  13. T ob1 = arr1[i];
  14. T ob2 = arr2[i];
  15. if (!equals(ob1, ob2)) {
  16. return false;
  17. }
  18. }
  19. return true;
  20. }
  21. }

代码示例来源:origin: FasterXML/jackson-module-jsonSchema

  1. protected static <T> boolean arraysEqual(T[] arr1, T[] arr2) {
  2. if (arr1 == null) {
  3. return arr2 == null;
  4. }
  5. if (arr2 == null) {
  6. return false;
  7. }
  8. int len = arr1.length;
  9. if (len != arr2.length) {
  10. return false;
  11. }
  12. for (int i = 0; i < len; ++i) {
  13. T ob1 = arr1[i];
  14. T ob2 = arr2[i];
  15. if (!equals(ob1, ob2)) {
  16. return false;
  17. }
  18. }
  19. return true;
  20. }
  21. }

代码示例来源:origin: org.graylog2/graylog2-server

  1. @Override
  2. public boolean equals(Object o) {
  3. if (o == this) {
  4. return true;
  5. }
  6. if (o instanceof RotationStrategyDescription) {
  7. RotationStrategyDescription that = (RotationStrategyDescription) o;
  8. return (this.type.equals(that.type()))
  9. && (this.defaultConfig.equals(that.defaultConfig()))
  10. && (this.jsonSchema.equals(that.jsonSchema()));
  11. }
  12. return false;
  13. }

代码示例来源:origin: org.graylog2/graylog2-server

  1. @Override
  2. public boolean equals(Object o) {
  3. if (o == this) {
  4. return true;
  5. }
  6. if (o instanceof RetentionStrategyDescription) {
  7. RetentionStrategyDescription that = (RetentionStrategyDescription) o;
  8. return (this.type.equals(that.type()))
  9. && (this.defaultConfig.equals(that.defaultConfig()))
  10. && (this.jsonSchema.equals(that.jsonSchema()));
  11. }
  12. return false;
  13. }

代码示例来源:origin: com.fasterxml.jackson.module/jackson-module-jsonSchema

  1. protected boolean _equals(JsonSchema that)
  2. {
  3. return equals(getId(), getId())
  4. // 27-Apr-2015, tatu: Should not need to check type explicitly
  5. // && equals(getType(), getType())
  6. && equals(getRequired(), that.getRequired())
  7. && equals(getReadonly(), that.getReadonly())
  8. && equals(get$ref(), that.get$ref())
  9. && equals(get$schema(), that.get$schema())
  10. && arraysEqual(getDisallow(), that.getDisallow())
  11. && arraysEqual(getExtends(), that.getExtends());
  12. }

代码示例来源:origin: FasterXML/jackson-module-jsonSchema

  1. protected boolean _equals(JsonSchema that)
  2. {
  3. return equals(getId(), getId())
  4. // 27-Apr-2015, tatu: Should not need to check type explicitly
  5. // && equals(getType(), getType())
  6. && equals(getRequired(), that.getRequired())
  7. && equals(getReadonly(), that.getReadonly())
  8. && equals(get$ref(), that.get$ref())
  9. && equals(get$schema(), that.get$schema())
  10. && arraysEqual(getDisallow(), that.getDisallow())
  11. && arraysEqual(getExtends(), that.getExtends());
  12. }

相关文章