Tabnine Logo
com.natpryce.makeiteasy
Code IndexAdd Tabnine to your IDE (free)

How to use com.natpryce.makeiteasy

Best Java code snippets using com.natpryce.makeiteasy (Showing top 20 results out of 315)

origin: npryce/make-it-easy

@Override
public <V> V valueOf(Property<? super T, V> property, V defaultValue) {
  return valueOf(property, new SameValueDonor<>(defaultValue));
}
 
origin: com.natpryce/make-it-easy

public static <T,V> PropertyValue<T,V> withNull(Property<T,V> property) {
  return new PropertyValue<>(property, new SameValueDonor<V>(null));
}
origin: npryce/make-it-easy

  /**
   * The property's value
   */
  public V value() {
    return valueDonor.value();
  }
}
origin: npryce/make-it-easy

  @Override
  public FruitBowl instantiate(PropertyLookup<FruitBowl> lookup) {
    return new FruitBowl(
        lookup.valueOf(contents, listOf(an(Apple), a(Banana)).value()));
  }
};
origin: npryce/make-it-easy

public static void howToMakeSimpleObjects() {
  Maker<Apple> appleWith2Leaves = an(Apple, with(2, leaves));
  Maker<Apple> ripeApple = appleWith2Leaves.but(with(ripeness, 0.9));
  Maker<Apple> unripeApple = appleWith2Leaves.but(with(ripeness, 0.125));
  Apple apple1 = make(ripeApple);
  Apple apple2 = make(unripeApple);
  Banana defaultBanana = make(a(Banana));
  Banana straightBanana = make(a(Banana, with(curve, 0.0)));
  Banana squishyBanana = make(a(Banana, with(ripeness, 1.0)));
}
origin: com.natpryce/make-it-easy

public static <T> Donor<T> theSame(Donor<T> originalDonor) {
  return new SameValueDonor<>(originalDonor.value());
}

origin: npryce/make-it-easy

  @Override
  public AppleCart instantiate(PropertyLookup<AppleCart> lookup) {
    return new AppleCart(lookup.valueOf(apples, listOf(an(Apple))));
  }
};
origin: npryce/make-it-easy

  @Override
  public ThingContainer instantiate(PropertyLookup<ThingContainer> lookup) {
    return new ThingContainer(lookup.valueOf(thing, make(a(ThingToMake))));
  }
};
origin: npryce/make-it-easy

  public static void howToMakeGenericObjects() {
    Tree<Banana> bananaTree = make(a(BananaTree,
      with(bananas, setOf(a(Banana), a(Banana), a(Banana)))));
  }
}
origin: npryce/make-it-easy

  public static <T,V> Property<T,V> newProperty() {
    return new Property<>();
  }
}
origin: com.natpryce/make-it-easy

/**
 * Makes a new object.
 *
 * The {@link com.natpryce.makeiteasy.MakeItEasy#make(Maker) MakeItEasy.make} method
 * is syntactic sugar to make calls to this method read more naturally in most
 * contexts.
 *
 * @return a new object
 */
public T make() {
  return instantiator.instantiate(this);
}
origin: com.natpryce/make-it-easy

public static <T,V,W extends V> PropertyValue<T,V> with(Property<T,V> property, W value) {
  return new PropertyValue<>(property, new SameValueDonor<V>(value));
}
origin: npryce/make-it-easy

public static <T> Donor<T> theSame(Donor<T> originalDonor) {
  return new SameValueDonor<>(originalDonor.value());
}

origin: com.natpryce/make-it-easy

@Override
public <V> V valueOf(Property<? super T, V> property, V defaultValue) {
  return valueOf(property, new SameValueDonor<>(defaultValue));
}
 
origin: com.natpryce/make-it-easy

  /**
   * The property's value
   */
  public V value() {
    return valueDonor.value();
  }
}
origin: com.natpryce/make-it-easy

  public static <T,V> Property<T,V> newProperty() {
    return new Property<>();
  }
}
origin: npryce/make-it-easy

public static <T,V,W extends V> PropertyValue<T,V> with(Property<T,V> property, W value) {
  return new PropertyValue<>(property, new SameValueDonor<V>(value));
}
origin: npryce/make-it-easy

public static <T,V,W extends V> PropertyValue<T,V> with(W value, Property<T,V> property) {
  return new PropertyValue<>(property, new SameValueDonor<V>(value));
}
origin: npryce/make-it-easy

public static <T,V> PropertyValue<T,V> withNull(Property<T,V> property) {
  return new PropertyValue<>(property, new SameValueDonor<V>(null));
}
origin: com.natpryce/make-it-easy

public static <T,V,W extends V> PropertyValue<T,V> with(W value, Property<T,V> property) {
  return new PropertyValue<>(property, new SameValueDonor<V>(value));
}
com.natpryce.makeiteasy

Most used classes

  • Donor
    Provides a value or values to other things.
  • MakeItEasy
    Syntactic sugar for using Make It Easy test-data builders.
  • Maker
    Makes objects of a given type with a specified initial state.
  • Instantiator
    Instantiates an object, with an initial state specified by some given property values or defaults de
  • NewCollectionDonor
  • PropertyValue,
  • SameValueDonor,
  • SequenceDonor,
  • ChainedSequence,
  • ElementsSequence,
  • IndexedSequence,
  • PropertyLookup,
  • MakeItEasyTest$ThingContainer,
  • MakeItEasyTest$ThingToMake,
  • PropertyValueSharingTest$Identified,
  • PropertyValueSharingTest$Identity,
  • PropertyValueSharingTest$SecretAgent
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now