public DiffBuilder append()

in src/main/java/org/apache/commons/lang3/builder/DiffBuilder.java [513:548]


    public DiffBuilder<T> append(final String fieldName, final Object lhs, final Object rhs) {
        if (equals || lhs == rhs) {
            return this;
        }
        // rhs cannot be null, as lhs != rhs
        final Object test = lhs != null ? lhs : rhs;
        if (ObjectUtils.isArray(test)) {
            if (test instanceof boolean[]) {
                return append(fieldName, (boolean[]) lhs, (boolean[]) rhs);
            }
            if (test instanceof byte[]) {
                return append(fieldName, (byte[]) lhs, (byte[]) rhs);
            }
            if (test instanceof char[]) {
                return append(fieldName, (char[]) lhs, (char[]) rhs);
            }
            if (test instanceof double[]) {
                return append(fieldName, (double[]) lhs, (double[]) rhs);
            }
            if (test instanceof float[]) {
                return append(fieldName, (float[]) lhs, (float[]) rhs);
            }
            if (test instanceof int[]) {
                return append(fieldName, (int[]) lhs, (int[]) rhs);
            }
            if (test instanceof long[]) {
                return append(fieldName, (long[]) lhs, (long[]) rhs);
            }
            if (test instanceof short[]) {
                return append(fieldName, (short[]) lhs, (short[]) rhs);
            }
            return append(fieldName, (Object[]) lhs, (Object[]) rhs);
        }
        // Not array type
        return Objects.equals(lhs, rhs) ? this : add(fieldName, () -> lhs, () -> rhs, Object.class);
    }