
uk.co.it.modular.beans.InstanceFactories Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bean-builder Show documentation
Show all versions of bean-builder Show documentation
A library to support configurable instantiation and population of classes which implement the Java Beans standard
/*
* Copyright (c) Modular IT Limited.
*/
package uk.co.it.modular.beans;
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import org.apache.commons.lang.math.RandomUtils;
import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
import static org.apache.commons.lang.math.RandomUtils.*;
import static org.apache.commons.lang.time.DateUtils.addSeconds;
/**
* @author Stewart Bissett
*/
public abstract class InstanceFactories {
private static final int MAX_STRING_LENGTH = 50;
private static final int MINUTES_PER_HOUR = 60;
private static final int HOURS_PER_DAY = 24;
private static final int DAYS_PER_YEAR = 365;
private static final int SECONDS_IN_A_YEAR = MINUTES_PER_HOUR * HOURS_PER_DAY * DAYS_PER_YEAR;
public static InstanceFactory theValue(final T value) {
return new InstanceFactory() {
public T createValue() {
return value;
}
};
}
public static InstanceFactory
© 2015 - 2025 Weber Informatics LLC | Privacy Policy