public static boolean isUnknown() { return getOperatingSystem().isUnknown(); } }
public static boolean isWindows() { return getOperatingSystem().isWindows(); }
public static String findProperty(String propertyName, String defaultValue) { String value = getSystemProperty(propertyName); if (StringUtils.isNotBlank(value)) { return value; } else { return findEnvironmentProperty(System.getenv(), propertyName, defaultValue); } }
public void assertError(String beanName, Type type, Object valueA, Object valueB) throws ComparisonException { Result result = assertError(beanName, type); // start by validating the basics if (EqualsUtils.objectsNotEqual(valueA, result.getValueA())) { String expectedName = ReflectUtils.getName(valueA); String actualName = ReflectUtils.getName(result.getValueA()); String msg = String.format("Value A is not \"%s\" (%s) as expected but rather \"%s\" (%s).", valueA, expectedName, result.getValueA(), actualName); throw new ComparisonException(msg); } if (EqualsUtils.objectsNotEqual(valueB, result.getValueB())) { String expectedName = ReflectUtils.getName(valueB); String actualName = ReflectUtils.getName(result.getValueB()); String msg = String.format("Value B is not \"%s\" (%s) as expected but rather \"%s\" (%s).", valueB, expectedName, result.getValueB(), actualName); throw new ComparisonException(msg); } }
/** * @return true if value.toString() is NOT null or NOT zero-length * @param value the object to be evaluated */ public static boolean isNotBlank(Object value) { return isBlank(value) == false; }
public static boolean isAnyNotBlank(Collection<?> values) { if (values == null) { return false; } for (Object value : values) { if (isNotBlank(value)) { return true; } } return false; }
public DestinationDef(String name, DestinationStatus destinationStatus, String provider, String... arguments) { this(name, destinationStatus, provider, BeanUtils.toMap(arguments)); }
public String extractSubject(String htmlContent) { String html = StringUtils.getTagContents(htmlContent, "html", 0); String head = StringUtils.getTagContents(html, "head", 0); return StringUtils.getTagContents(head, "title", 0); } }
public static boolean isMac() { return getOperatingSystem().isMac(); }
public static String toFixedLength(Object value, int length, char chr, String ellipsis) { if (length > 0) return fixedRight(value, length, chr, ellipsis); if (length < 0) return fixedLeft(value, length*-1, chr, ellipsis); return ""; } private static String fixedRight(Object value, int length, char chr, String ellipsis) {
public static LocalDateTime toLocalDateTime(int year, int monthOfYear, int dayOfMonth) { return factory.toLocalDateTimeWithMills(year, monthOfYear, dayOfMonth, 0, 0, 0, 0); } public static LocalDateTime toLocalDateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour) {
public UpdateAccountAction(String firstName, String lastName, String emailAddress) { this.emailAddress = StringUtils.emptyToNull(emailAddress); this.firstName = StringUtils.emptyToNull(firstName); this.lastName = StringUtils.emptyToNull(lastName); }
public static LocalDate toLocalDate(Date date) { return factory.toLocalDate(date); } public static LocalDate toLocalDate(Calendar date) {
public static java.util.Date toUtilDate(LocalDateTime date) { return factory.toUtilDate(date); } // public static java.util.Date toUtilDate(ZonedDateTime date) {
public static LocalTime toLocalTime(Object date) { return factory.toLocalTime(date); } public static LocalTime toLocalTime(String date) {
public static boolean datesEqual(Date dateA, Date dateB) { return EqualsUtils.datesEqual(dateA, dateB); } public static boolean datesNotEqual(Date dateA, Date dateB) {
public ComparisonResults build() { return new ComparisonResults(this.results); } }
public static boolean isAnyBlank(Collection<?> values) { if (values == null) { return false; } for (Object value : values) { if (isBlank(value)) { return true; } } return false; }
public static LocalDateTime toLocalDateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute) { return factory.toLocalDateTimeWithMills(year, monthOfYear, dayOfMonth, hourOfDay, minuteOfHour, secondOfMinute, 0); } public static LocalDateTime toLocalDateTimeWithMills(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond) {