Dart DocumentationprincipalRequirement<T>

Requirement<T> class

A single requirement that can be required or provided.

class Requirement<T> {

 /**
  * The value of this requirement. Can be anything.
  */
 final T value;

 /**
  * Creates a new requirement from the given value.
  */
 Requirement(this.value);

 /**
  * Returns whether this requirement value is equal to the other.
  */
 bool operator ==(Requirement<T> other) => value == other.value;

 int get hashCode => value.hashCode;

 String toString() => 'Requirement<$value>';

}

Constructors

new Requirement(T value) #

Creates a new requirement from the given value.

Requirement(this.value);

Properties

final int hashCode #

Get a hash code for this object.

All objects have hash codes. Hash codes are guaranteed to be the same for objects that are equal when compared using the equality operator ==. Other than that there are no guarantees about the hash codes. They will not be consistent between runs and there are no distribution guarantees.

If a subclass overrides hashCode it should override the equality operator as well to maintain consistency.

docs inherited from Object
int get hashCode => value.hashCode;

final T value #

The value of this requirement. Can be anything.

final T value;

Operators

bool operator ==(Requirement<T> other) #

Returns whether this requirement value is equal to the other.

bool operator ==(Requirement<T> other) => value == other.value;

Methods

String toString() #

Returns a string representation of this object.

docs inherited from Object
String toString() => 'Requirement<$value>';