Show / Hide Table of Contents

Interface IValueExtractor

IValueExtractor is used to both extract values (for example, for sorting or filtering) from an object, and to provide an identity for that extraction.

Namespace: Tangosol.Util
Assembly: Coherence.dll
Syntax
public interface IValueExtractor
Remarks

Important Note: all classes that implement IValueExtractor interface must explicitly implement the GetHashCode() and Equals(object) methods in a way that is based solely on the object's serializable state.

Methods

Equals(object)

Compare the IValueExtractor with another object to determine equality.

Declaration
bool Equals(object o)
Parameters
Type Name Description
object o

The reference object with which to compare.

Returns
Type Description
bool

true if this IValueExtractor and the passed object are equivalent.

Remarks

Two IValueExtractor objects, ve1 and ve2 are considered equal if ve1.Extract(o) equals ve2.Extract(o) for all values of o.

Extract(object)

Extract the value from the passed object.

Declaration
object Extract(object target)
Parameters
Type Name Description
object target

An object to retrieve the value from.

Returns
Type Description
object

The extracted value as an object; null is an acceptable value.

Remarks

The returned value may be null.

Exceptions
Type Condition
InvalidCastException

If this IValueExtractor is incompatible with the passed object to extract a value from and the implementation requires the passed object to be of a certain type.

ArgumentException

If this IValueExtractor cannot handle the passed object for any other reason; an implementor should include a descriptive message.

GetHashCode()

Determine a hash value for the IValueExtractor object according to the general object.GetHashCode contract.

Declaration
int GetHashCode()
Returns
Type Description
int

An integer hash value for this IValueExtractor object.

ToString()

Provide a human-readable description of this IValueExtractor object.

Declaration
string ToString()
Returns
Type Description
string

A human-readable description of this IValueExtractor object.

In this article
Back to top Copyright © 2000, 2024, Oracle and/or its affiliates.