protected Object[] getObjects() { Object[] values = new Object[suppliers.length]; for(int i = 0; i < suppliers.length; i ++) { Supplier<?> s = suppliers[i]; if (s != null) { values[i] = s.get(); } } return values; } }
protected Object[] getObjects() { Object[] values = new Object[suppliers.length]; for(int i = 0; i < suppliers.length; i ++) { Supplier<?> s = suppliers[i]; if (s != null) { values[i] = s.get(); } } return values; } }
public T getValue() { return value.get(); } }
public T getValue() { return value.get(); } }
private TimeZone getTimeZone(Object[] params) { TimeZone defaultValue = TimeZone.getDefault(); if (params != null) { for(Object o : params) { if (o instanceof Supplier) { Supplier s = (Supplier) o; Object o1 = s.get(); if (o1 instanceof TimeZone) { return (TimeZone) o1; } } } } return defaultValue; }
private TimeZone getTimeZone(Object[] params) { TimeZone defaultValue = TimeZone.getDefault(); if (params != null) { for(Object o : params) { if (o instanceof Supplier) { Supplier s = (Supplier) o; Object o1 = s.get(); if (o1 instanceof TimeZone) { return (TimeZone) o1; } } } } return defaultValue; }
public static boolean isSupplierOf(Object potentialSupplier, Class<?> supplyClass) { if (!Supplier.class.isInstance(potentialSupplier)) { return false; } Object supply = ((Supplier)potentialSupplier).get(); if (supply == null) return false; return supplyClass.isInstance(supply); }
public static boolean isSupplierOf(Object potentialSupplier, Class<?> supplyClass) { if (!Supplier.class.isInstance(potentialSupplier)) { return false; } Object supply = ((Supplier)potentialSupplier).get(); if (supply == null) return false; return supplyClass.isInstance(supply); }
@Override public Context newContext() { Object[] resources = new Object[suppliers.length]; for(int i = 0; i < resources.length; i++) { resources[i] = suppliers[i].get(); } return new DefaultContext(resources); } }
@SuppressWarnings("unchecked") private ZoneOffset getZoneOffset(Object[] params) { for(Object prop : params) { if (prop instanceof ZoneOffset) { return (ZoneOffset) prop; } else if (SupplierHelper.isSupplierOf(prop, ZoneOffset.class)) { return ((Supplier<ZoneOffset>)prop).get(); } } return ZoneOffset.UTC; } });
@SuppressWarnings("unchecked") private ZoneOffset getZoneOffset(Object[] params) { for(Object prop : params) { if (prop instanceof ZoneOffset) { return (ZoneOffset) prop; } else if (SupplierHelper.isSupplierOf(prop, ZoneOffset.class)) { return ((Supplier<ZoneOffset>)prop).get(); } } return ZoneOffset.UTC; } });
@Override public Context newContext() { Object[] resources = new Object[suppliers.length]; for(int i = 0; i < resources.length; i++) { resources[i] = suppliers[i].get(); } return new DefaultContext(resources); } }
@SuppressWarnings("unchecked") public static ZoneId getZoneId(Object[] params) { if (params != null) { for(Object p : params) { if (p instanceof ZoneId) { return (ZoneId) p; } else if (p instanceof TimeZone) { return ((TimeZone)p).toZoneId(); } else if (SupplierHelper.isSupplierOf(p, ZoneId.class)) { return ((Supplier<ZoneId>)p).get(); } else if (SupplierHelper.isSupplierOf(p, TimeZone.class)) { return (((Supplier<TimeZone>)p).get()).toZoneId(); } } } return null; }
@SuppressWarnings("unchecked") public static ZoneId getZoneId(Object[] params) { if (params != null) { for(Object p : params) { if (p instanceof ZoneId) { return (ZoneId) p; } else if (p instanceof TimeZone) { return ((TimeZone)p).toZoneId(); } else if (SupplierHelper.isSupplierOf(p, ZoneId.class)) { return ((Supplier<ZoneId>)p).get(); } else if (SupplierHelper.isSupplierOf(p, TimeZone.class)) { return (((Supplier<TimeZone>)p).get()).toZoneId(); } } } return null; }
@SuppressWarnings("unchecked") private static DateTimeZone getDateTimeZone(Object[] params) { if (params != null) { for(Object p : params) { if (p instanceof DateTimeZone) { return (DateTimeZone) p; } else if (p instanceof TimeZone) { return DateTimeZone.forTimeZone((TimeZone)p); } else if (SupplierHelper.isSupplierOf(p, DateTimeZone.class)) { return ((Supplier<DateTimeZone>)p).get(); } else if (SupplierHelper.isSupplierOf(p, TimeZone.class)) { return DateTimeZone.forTimeZone(((Supplier<TimeZone>)p).get()); } } } return null; } }
@SuppressWarnings("unchecked") private static DateTimeFormatter toDateTimeFormatter(Object prop, ZoneId zoneId) { if (SupplierHelper.isSupplierOf(prop, DateTimeFormatter.class)) { return withZone(((Supplier<DateTimeFormatter>) prop).get(), zoneId); } else if (prop instanceof DateFormatSupplier) { return withZone(((DateFormatSupplier) prop).get(), zoneId); } else if (prop instanceof DateTimeFormatter) { return (DateTimeFormatter) prop; } return null; }
@SuppressWarnings("unchecked") private static DateTimeFormatter toDateTimeFormater(Object prop, DateTimeZone dateTimeZone) { if (SupplierHelper.isSupplierOf(prop, DateTimeFormatter.class)) { return (withZone(((Supplier<DateTimeFormatter>) prop).get(), dateTimeZone)); } else if (prop instanceof DateFormatSupplier) { return (withZone(((DateFormatSupplier)prop).get(), dateTimeZone)); } else if (prop instanceof DateTimeFormatter) { return (DateTimeFormatter) prop; } return null; }
@SuppressWarnings("unchecked") private static DateTimeFormatter toDateTimeFormatter(Object prop, ZoneId zoneId) { if (SupplierHelper.isSupplierOf(prop, DateTimeFormatter.class)) { return withZone(((Supplier<DateTimeFormatter>) prop).get(), zoneId); } else if (prop instanceof DateFormatSupplier) { return withZone(((DateFormatSupplier) prop).get(), zoneId); } else if (prop instanceof DateTimeFormatter) { return (DateTimeFormatter) prop; } return null; }
getter = lookForAlternativeGetter(propertyClassMetaSupplier.get(), columnKey, columnDefinition, new HashSet<Type>(), mappingContextFactoryBuilder);
getter = lookForAlternativeGetter(propertyClassMetaSupplier.get(), columnKey, columnDefinition, new HashSet<Type>(), mappingContextFactoryBuilder);