Example usage for com.google.common.base Function equals

List of usage examples for com.google.common.base Function equals

Introduction

In this page you can find the example usage for com.google.common.base Function equals.

Prototype

@Override
boolean equals(@Nullable Object object);

Source Link

Document

Indicates whether another object is equal to this function.

Usage

From source file:com.lyndir.lhunath.opal.system.util.NNFunctionNN.java

static <F, T> NNFunctionNN<F, T> of(final Function<F, T> func) {

    return new NNFunctionNN<F, T>() {
        @Nonnull/*from   w w w  .  j a  v a2 s . c o  m*/
        @Override
        public T apply(@Nonnull final F input) {

            return Verify.verifyNotNull(func.apply(input));
        }

        @Override
        @SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
        public boolean equals(@Nonnull final Object object) {

            return func.equals(object);
        }

        @Override
        public int hashCode() {

            return func.hashCode();
        }
    };
}