I seem to recall that there is a specific term for an accessor method that returns a Boolean value but it escapes me. For example: typical methods such as:
class Example {
bool isDirty();
bool hasChildren();
bool isValid(SomeType obj);
};
I will also settle for such a term as applied to a non-member functions.
Best Answer
A function from some type
T
toBoolean
is usually called a predicate, and if you want to make clear that it is a method of an object, i.e. that it takes the implicitthis
argument in addition to its other arguments, then you could call it a predicate method. If it takes no other arguments except the implicitthis
argument, then you can call it a predicate property.See for example
Predicate<T>
in .NET and e.g.javax.sql.rowset.Predicate
orcom.google.common.base.Predicate
in Java.