Java Code Examples for java.util.Objects.deepEquals()

The following are Jave code examples for showing how to use deepEquals() of the java.util.Objects class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: elasticsearch_my   File: PercentileRanksAggregationBuilder.java   Source Code and License Vote up 6 votes
@Override
protected boolean innerEquals(Object obj) {
    PercentileRanksAggregationBuilder other = (PercentileRanksAggregationBuilder) obj;
    if (!Objects.equals(method, other.method)) {
        return false;
    }
    boolean equalSettings = false;
    switch (method) {
    case HDR:
        equalSettings = Objects.equals(numberOfSignificantValueDigits, other.numberOfSignificantValueDigits);
        break;
    case TDIGEST:
        equalSettings = Objects.equals(compression, other.compression);
        break;
    default:
        throw new IllegalStateException("Illegal method [" + method + "]");
    }
    return equalSettings
            && Objects.deepEquals(values, other.values)
            && Objects.equals(keyed, other.keyed)
            && Objects.equals(method, other.method);
}
 
Example 2
Project: elasticsearch_my   File: AbstractPipelineAggregationBuilder.java   Source Code and License Vote up 6 votes
@Override
public boolean equals(Object obj) {
    if (obj == null)
        return false;
    if (getClass() != obj.getClass())
        return false;
    @SuppressWarnings("unchecked")
    AbstractPipelineAggregationBuilder<PAB> other = (AbstractPipelineAggregationBuilder<PAB>) obj;
    if (!Objects.equals(name, other.name))
        return false;
    if (!Objects.equals(type, other.type))
        return false;
    if (!Objects.deepEquals(bucketsPaths, other.bucketsPaths))
        return false;
    if (!Objects.equals(metaData, other.metaData))
        return false;
    return doEquals(obj);
}
 
Example 3
Project: Cognizant-Intelligent-Test-Scripter   File: ImageORTable.java   Source Code and License Vote up 6 votes
public ImageORTable(ImageORPanel imageOR) {
    this.imageOR = imageOR;
    table = new XTable();
    toolBar = new Toolbar();
    cardLayout = new CardLayout();
    cardPanel = new JPanel(cardLayout);
    imagePanel = new ImagePanel();
    propertyEditor = new PropertyEditor() {
        @Override
        public void onClose(ImageORObject object) {
            if (Objects.deepEquals(getObject(), object)) {
                loadObject(object);
                table.repaint();
            }
        }
    };
    init();
}
 
Example 4
Project: jdk8u-jdk   File: TestBase64Golden.java   Source Code and License Vote up 6 votes
private static void test1() throws Exception {
    byte[] src = new byte[] {
        46, -97, -35, -44, 127, -60, -39, -4, -112, 34, -57, 47, -14, 67,
        40, 18, 90, -59, 68, 112, 23, 121, -91, 94, 35, 49, 104, 17, 30,
        -80, -104, -3, -53, 27, 38, -72, -47, 113, -52, 18, 5, -126 };
    Encoder encoder = Base64.getMimeEncoder(49, new byte[] { 0x7e });
    byte[] encoded = encoder.encode(src);
    Decoder decoder = Base64.getMimeDecoder();
    byte[] decoded = decoder.decode(encoded);
    if (!Objects.deepEquals(src, decoded)) {
        throw new RuntimeException();
    }
}
 
Example 5
Project: openjdk-jdk10   File: SimpleUpdateConfigurationTest.java   Source Code and License Vote up 5 votes
private static void assertDeepEquals(Object expected, Object received, String msg) {
    if (!Objects.deepEquals(expected, received)) {
        throw new TestAssertException("Unexpected result for " + msg
                + ".\n\texpected: " + deepToString(expected)
                +  "\n\tactual:   " + deepToString(received));
    } else {
        System.out.println("Got expected " + msg + ": " + deepToString(received));
    }
}
 
Example 6
Project: incubator-netbeans   File: MessagesHandler.java   Source Code and License Vote up 5 votes
private boolean compareRepeating(LogRecord r1, LogRecord r2) {
    return r1.getLevel().equals(r2.getLevel()) &&
           Objects.equals(r1.getLoggerName(), r2.getLoggerName()) &&
           Objects.equals(r1.getMessage(), r2.getMessage()) &&
           Objects.deepEquals(r1.getParameters(), r2.getParameters()) &&
           Objects.equals(r1.getResourceBundle(), r2.getResourceBundle()) &&
           Objects.equals(r1.getResourceBundleName(), r2.getResourceBundleName()) &&
           Objects.equals(r1.getSourceClassName(), r2.getSourceClassName()) &&
           Objects.equals(r1.getSourceMethodName(), r2.getSourceMethodName()) &&
           //r1.getThreadID() == r2.getThreadID() &&
           compareThrown(r1.getThrown(), r2.getThrown());
}
 
Example 7
Project: openjdk-jdk10   File: TestBase64Golden.java   Source Code and License Vote up 5 votes
private static void test1() throws Exception {
    byte[] src = new byte[] {
        46, -97, -35, -44, 127, -60, -39, -4, -112, 34, -57, 47, -14, 67,
        40, 18, 90, -59, 68, 112, 23, 121, -91, 94, 35, 49, 104, 17, 30,
        -80, -104, -3, -53, 27, 38, -72, -47, 113, -52, 18, 5, -126 };
    Encoder encoder = Base64.getMimeEncoder(49, new byte[] { 0x7e });
    byte[] encoded = encoder.encode(src);
    Decoder decoder = Base64.getMimeDecoder();
    byte[] decoded = decoder.decode(encoded);
    if (!Objects.deepEquals(src, decoded)) {
        throw new RuntimeException();
    }
}
 
Example 8
Project: elasticsearch_my   File: ActionPlugin.java   Source Code and License Vote up 5 votes
@Override
public boolean equals(Object obj) {
    if (obj == null || obj.getClass() != ActionHandler.class) {
        return false;
    }
    ActionHandler<?, ?> other = (ActionHandler<?, ?>) obj;
    return Objects.equals(action, other.action)
            && Objects.equals(transportAction, other.transportAction)
            && Objects.deepEquals(supportTransportActions, other.supportTransportActions);
}
 
Example 9
Project: smart-testing   File: ConfigurationAssert.java   Source Code and License Vote up 5 votes
public ConfigurationAssert hasScmRange(Range range) {
    isNotNull();

    if(Objects.deepEquals(actual.getScm().getRange(), range)) {
        failWithMessage("Expected SCM range to be <%s> but was <%s>", range, actual.getScm().getRange());
    }
    return this;
}
 
Example 10
Project: Cognizant-Intelligent-Test-Scripter   File: QCRestClient.java   Source Code and License Vote up 5 votes
public boolean isLoggedIn() {
    try {
        JSONObject res = httpClient.Get(this.getUrl(buildUrl(IS_LOGGED_IN)));
        return res != null && Objects.deepEquals(200, res.get("status"))
                && Objects.toString(res.get("res"), "").contains(usr);
    } catch (Exception ex) {
        LOG.log(Level.SEVERE, null, ex);
    }
    return false;
}
 
Example 11
Project: jdk8u-jdk   File: TestBase64Golden.java   Source Code and License Vote up 5 votes
private static void assertEqual(Object result, Object expect) {
    if (!Objects.deepEquals(result, expect)) {
        String resultStr = result.toString();
        String expectStr = expect.toString();
        if (result instanceof byte[]) {
            resultStr = new String((byte[]) result, DEF_CHARSET);
        }
        if (expect instanceof byte[]) {
            expectStr = new String((byte[]) expect, DEF_CHARSET);
        }
        throw new RuntimeException(DEF_EXCEPTION_MSG +
            " result: " + resultStr + " expected: " + expectStr);
    }
}
 
Example 12
Project: flux-capacitor-client   File: Data.java   Source Code and License Vote up 5 votes
@Override
public boolean equals(Object o) {
    if (this == o) {
        return true;
    }
    if (o == null || getClass() != o.getClass()) {
        return false;
    }
    Data<?> data = (Data<?>) o;
    return revision == data.revision &&
            Objects.deepEquals(value, data.value) &&
            Objects.equals(type, data.type);
}
 
Example 13
Project: openjdk-jdk10   File: TestLoggerFinder.java   Source Code and License Vote up 4 votes
@Override
public boolean equals(Object obj) {
    return obj instanceof LogEvent
            && Objects.deepEquals(this.toArray(), ((LogEvent)obj).toArray());
}
 
Example 14
Project: elasticsearch_my   File: PercentilesBucketPipelineAggregationBuilder.java   Source Code and License Vote up 4 votes
@Override
protected boolean innerEquals(BucketMetricsPipelineAggregationBuilder<PercentilesBucketPipelineAggregationBuilder> obj) {
    PercentilesBucketPipelineAggregationBuilder other = (PercentilesBucketPipelineAggregationBuilder) obj;
    return Objects.deepEquals(percents, other.percents);
}
 
Example 15
Project: rskj   File: ValueTest.java   Source Code and License Vote up 4 votes
public static boolean cmp(Value value, Value o) {
    return Objects.deepEquals(value.asObj(), o.asObj());
}
 
Example 16
Project: openjdk-jdk10   File: BasePlatformLoggerTest.java   Source Code and License Vote up 4 votes
@Override
public boolean equals(Object obj) {
    return obj instanceof LogEvent
            && Objects.deepEquals(this.toArray(), ((LogEvent)obj).toArray());
}
 
Example 17
Project: Cognizant-Intelligent-Test-Scripter   File: ExecutionStep.java   Source Code and License Vote up 4 votes
public Boolean isDuplicate(ExecutionStep step) {
    return Objects.deepEquals(step.exeStepDetails, exeStepDetails);
}
 
Example 18
Project: openjdk-jdk10   File: DefaultPlatformLoggerTest.java   Source Code and License Vote up 4 votes
@Override
public boolean equals(Object obj) {
    return obj instanceof LogEvent
            && Objects.deepEquals(this.toArray(), ((LogEvent)obj).toArray());
}
 
Example 19
Project: openjdk-jdk10   File: LoggerBridgeTest.java   Source Code and License Vote up 4 votes
@Override
public boolean equals(Object obj) {
    return obj instanceof LogEvent
            && Objects.deepEquals(this.toArray(), ((LogEvent)obj).toArray());
}
 
Example 20
Project: openjdk-jdk10   File: CustomLoggerTest.java   Source Code and License Vote up 4 votes
@Override
public boolean equals(Object obj) {
    return obj instanceof LogEvent
            && Objects.deepEquals(this.toArray(), ((LogEvent)obj).toArray());
}