proj_name
stringclasses
131 values
relative_path
stringlengths
30
228
class_name
stringlengths
1
68
func_name
stringlengths
1
48
masked_class
stringlengths
78
9.82k
func_body
stringlengths
46
9.61k
len_input
int64
29
2.01k
len_output
int64
14
1.94k
total
int64
55
2.05k
relevant_context
stringlengths
0
38.4k
speedment_speedment
speedment/runtime-parent/runtime-compute/src/main/java/com/speedment/runtime/compute/internal/ToByteNullableImpl.java
ToByteNullableImpl
compare
class ToByteNullableImpl<T> implements NullableExpression<T, ToByte<T>>, ToByteNullable<T> { private final ToByte<T> original; private final Predicate<T> isNull; public ToByteNullableImpl(ToByte<T> original, Predicate<T> isNull) { this.original = requireNonNull(original); this.isNull = r...
final boolean f = isNull(first); final boolean s = isNull(second); if (f && s) return 0; else if (f) return 1; else if (s) return -1; else return Byte.compare( original.applyAsByte(first), original.applyAsByte(second) );
768
90
858
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-compute/src/main/java/com/speedment/runtime/compute/internal/ToEnumNullableImpl.java
ToEnumNullableImpl
compare
class ToEnumNullableImpl<T, E extends Enum<E>> implements ToEnumNullable<T, E> { private final Class<E> enumClass; private final Function<T, E> inner; public ToEnumNullableImpl(Class<E> enumClass, Function<T, E> inner) { this.enumClass = requireNonNull(enumClass); this.inner = requ...
final E f = apply(first); final E s = apply(second); if (f == null && s == null) { return 0; } else if (f == null) { return 1; } else if (s == null) { return -1; } else { return Integer.compare(f.ordinal(), s.ordinal()); ...
319
101
420
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-compute/src/main/java/com/speedment/runtime/compute/internal/ToFloatNullableImpl.java
ToFloatNullableImpl
compare
class ToFloatNullableImpl<T> implements NullableExpression<T, ToFloat<T>>, ToFloatNullable<T> { private final ToFloat<T> original; private final Predicate<T> isNull; public ToFloatNullableImpl(ToFloat<T> original, Predicate<T> isNull) { this.original = requireNonNull(original); this.isNull...
final boolean f = isNull(first); final boolean s = isNull(second); if (f && s) return 0; else if (f) return 1; else if (s) return -1; else return Float.compare( original.applyAsFloat(first), original.applyAsFloat(second) );
780
91
871
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-compute/src/main/java/com/speedment/runtime/compute/internal/ToLongNullableImpl.java
ToLongNullableImpl
equals
class ToLongNullableImpl<T> implements NullableExpression<T, ToLong<T>>, ToLongNullable<T> { private final ToLong<T> original; private final Predicate<T> isNull; public ToLongNullableImpl(ToLong<T> original, Predicate<T> isNull) { this.original = requireNonNull(original); this.isNull ...
if (this == o) return true; else if (!(o instanceof NullableExpression)) return false; final NullableExpression<?, ?> that = (NullableExpression<?, ?>) o; return Objects.equals(original, that.inner()) && Objects.equals(isNull, that.isNullPredicate());
771
83
854
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-compute/src/main/java/com/speedment/runtime/compute/internal/ToShortNullableImpl.java
ToShortNullableImpl
equals
class ToShortNullableImpl<T> implements NullableExpression<T, ToShort<T>>, ToShortNullable<T> { private final ToShort<T> original; private final Predicate<T> isNull; public ToShortNullableImpl(ToShort<T> original, Predicate<T> isNull) { this.original = requireNonNull(original); this.isNull...
if (this == o) return true; else if (!(o instanceof NullableExpression)) return false; final NullableExpression<?, ?> that = (NullableExpression<?, ?>) o; return Objects.equals(original, that.inner()) && Objects.equals(isNull, that.isNullPredicate());
775
83
858
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-compute/src/main/java/com/speedment/runtime/compute/internal/expression/AbsUtil.java
AbsLong
applyAsLong
class AbsLong extends AbstractAbs<T, ToLong<T>> implements ToLong<T> { private AbsLong(ToLong<T> inner) { super(inner); } @Override public long applyAsLong(T object) {<FILL_FUNCTION_BODY>} }
final long value = inner.applyAsLong(object); return value < 0 ? -value : value;
77
29
106
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-compute/src/main/java/com/speedment/runtime/compute/internal/expression/CastUtil.java
DoubleToLong
castBigDecimalToLong
class DoubleToLong extends CastToLong<T, ToDouble<T>> { private DoubleToLong(ToDouble<T> tToDouble) { super(tToDouble); } @Override public long applyAsLong(T object) { return (long) inner.applyAsDouble(object); } } ...
class BigDecimalToLong extends CastToLong<T, ToBigDecimal<T>> { private BigDecimalToLong(ToBigDecimal<T> tToBigDecimal) { super(tToBigDecimal); } @Override public long applyAsLong(T object) { return inner.apply(object).longValueEx...
212
112
324
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-compute/src/main/java/com/speedment/runtime/compute/internal/expression/ComposedUtil.java
ComposeToBoolean
applyAsBoolean
class ComposeToBoolean<T, A, AFTER extends ToBooleanFunction<A> & Expression<A>> implements ComposedExpression<T, A>, ToBoolean<T> { private final Function<T, A> before; private final AFTER after; ComposeToBoolean(Function<T, A> before, AFTER after) { this.before = requireN...
final A intermediate = before.apply(object); return intermediate != null && after.applyAsBoolean(intermediate);
193
32
225
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-compute/src/main/java/com/speedment/runtime/compute/internal/expression/MapperUtil.java
AbstractMapper
equals
class AbstractMapper<T, INNER extends Expression<T>, MAPPER> implements MapperExpression<T, INNER, MAPPER> { final INNER inner; final MAPPER mapper; AbstractMapper(INNER inner, MAPPER mapper) { this.inner = requireNonNull(inner); this.mapper = requireNonNull(mapper)...
if (this == o) return true; else if (!(o instanceof MapperExpression)) return false; final MapperExpression<?, ?, ?> that = (MapperExpression<?, ?, ?>) o; return Objects.equals(inner(), that.inner()) && Objects.equals(mapper(), that.mapper()) && ...
211
103
314
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-compute/src/main/java/com/speedment/runtime/compute/internal/expression/MinusUtil.java
LongMinusInt
longMinusLong
class LongMinusInt extends AbstractMinus<T, ToLong<T>, ToInt<T>> implements ToLong<T> { private LongMinusInt(ToLong<T> first, ToInt<T> second) { super(first, second); } @Override public long applyAsLong(T object) { return firstInner.applyA...
class LongMinusLong extends AbstractMinus<T, ToLong<T>, ToLong<T>> implements ToLong<T> { private LongMinusLong(ToLong<T> first, ToLong<T> second) { super(first, second); } @Override public long applyAsLong(T object) { return firs...
250
130
380
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-compute/src/main/java/com/speedment/runtime/compute/internal/expression/OrElseGetUtil.java
AbstractNonNullable
equals
class AbstractNonNullable <T, INNER extends Expression<T>, DEFAULT extends Expression<T>> implements OrElseGetExpression<T, INNER, DEFAULT> { final INNER inner; final DEFAULT getter; AbstractNonNullable(INNER inner, DEFAULT getter) { this.inner = requireNonNull(inner);...
if (this == o) return true; if (!(o instanceof OrElseGetExpression)) return false; final OrElseGetExpression<?, ?, ?> that = (OrElseGetExpression<?, ?, ?>) o; return Objects.equals(inner, that.innerNullable()) && Objects.equals(getter, that.defaultValueGe...
211
94
305
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-compute/src/main/java/com/speedment/runtime/compute/internal/expression/SignUtil.java
ShortSign
applyAsByte
class ShortSign extends AbstractSign<T, ToShort<T>> { private ShortSign(ToShort<T> tToShort) { super(tToShort); } @Override public byte applyAsByte(T object) {<FILL_FUNCTION_BODY>} }
final short value = inner.applyAsShort(object); if (value < 0) { return NEGATIVE; } else { return value > 0 ? POSITIVE : ZERO; }
75
58
133
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-compute/src/main/java/com/speedment/runtime/compute/internal/expression/SqrtUtil.java
IntSqrt
sqrtLong
class IntSqrt extends AbstractSqrt<T, ToInt<T>> { private IntSqrt(ToInt<T> tToInt) { super(tToInt); } @Override public double applyAsDouble(T object) { return Math.sqrt(inner.applyAsInt(object)); } } return new...
class LongSqrt extends AbstractSqrt<T, ToLong<T>> { private LongSqrt(ToLong<T> tToLong) { super(tToLong); } @Override public double applyAsDouble(T object) { return Math.sqrt(inner.applyAsLong(object)); } } ...
212
103
315
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-config/src/main/java/com/speedment/runtime/config/internal/AbstractChildDocument.java
AbstractChildDocument
getParent
class AbstractChildDocument<PARENT extends Document> extends BaseDocument implements HasParent<PARENT> { AbstractChildDocument(PARENT parent, Map<String, Object> data) { super(parent, data); } @Override public Optional<PARENT> getParent() {<FILL_FUNCTION_BODY>} @Override publ...
@SuppressWarnings("unchecked") final Optional<PARENT> parent = (Optional<PARENT>) super.getParent(); return parent;
113
42
155
<methods>public void <init>(com.speedment.runtime.config.Document, Map<java.lang.String,java.lang.Object>) ,public Stream<com.speedment.runtime.config.Document> children() ,public Optional<java.lang.Object> get(java.lang.String) ,public com.speedment.common.function.OptionalBoolean getAsBoolean(java.lang.String) ,publi...
speedment_speedment
speedment/runtime-parent/runtime-config/src/main/java/com/speedment/runtime/config/internal/ColumnLabelImpl.java
ColumnLabelImpl
toString
class ColumnLabelImpl implements ColumnLabel { private final String label; public ColumnLabelImpl(ColumnIdentifier<?> identifier) { label = identifier.getDbmsId() + "." + identifier.getSchemaId() + "." + identifier.getTableId() + "." + identifier.getColumnId(); }...
return "ColumnLabelImpl{" + "label='" + label + '\'' + '}';
221
29
250
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-config/src/main/java/com/speedment/runtime/config/internal/identifier/ColumnIdentifierImpl.java
ColumnIdentifierImpl
hashCode
class ColumnIdentifierImpl<ENTITY> implements ColumnIdentifier<ENTITY> { private final String dbmsName; private final String schemaName; private final String tableName; private final String columnName; public ColumnIdentifierImpl( final String dbmsName, final String schemaN...
int result = getDbmsId().hashCode(); result = 31 * result + getSchemaId().hashCode(); result = 31 * result + getTableId().hashCode(); result = 31 * result + getColumnId().hashCode(); return result;
454
69
523
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-config/src/main/java/com/speedment/runtime/config/internal/identifier/DbmsIdentifierImpl.java
DbmsIdentifierImpl
equals
class DbmsIdentifierImpl<ENTITY> implements DbmsIdentifier<ENTITY> { private final String dbmsName; public DbmsIdentifierImpl(String dbmsName) { this.dbmsName = requireNonNull(dbmsName); } @Override public String getDbmsId() { return dbmsName; } @Override public int h...
if (this == obj) { return true; } if (obj instanceof DbmsIdentifier) { final DbmsIdentifier<?> that = (DbmsIdentifier<?>) obj; return Objects.equals(dbmsName, that.getDbmsId()); } return false;
169
81
250
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-config/src/main/java/com/speedment/runtime/config/internal/identifier/SchemaIdentifierImpl.java
SchemaIdentifierImpl
equals
class SchemaIdentifierImpl<ENTITY> implements SchemaIdentifier<ENTITY> { private final String dbmsName; private final String schemaName; private final int hashCode; public SchemaIdentifierImpl(String dbmsName, String schemaName) { this.dbmsName = requireNonNull(dbmsName); this.schemaNa...
if (this == obj) { return true; } if (obj instanceof SchemaIdentifier) { final SchemaIdentifier<?> that = (SchemaIdentifier<?>) obj; return Objects.equals(dbmsName, that.getDbmsId()) && Objects.equals(schemaName, that.getSchem...
298
98
396
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-config/src/main/java/com/speedment/runtime/config/internal/identifier/TableIdentifierImpl.java
TableIdentifierImpl
equals
class TableIdentifierImpl<ENTITY> implements TableIdentifier<ENTITY> { private final String dbmsName; private final String schemaName; private final String tableName; private final int hashCode; public TableIdentifierImpl(String dbmsName, String schemaName, String tableName) { this.dbmsNam...
if (this == obj) { return true; } if (obj instanceof TableIdentifier) { final TableIdentifier<?> that = (TableIdentifier<?>) obj; return Objects.equals(dbmsName, that.getDbmsId()) && Objects.equals(schemaName, that.getSchemaId()) ...
368
110
478
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-config/src/main/java/com/speedment/runtime/config/internal/immutable/ImmutableForeignKeyColumn.java
ImmutableForeignKeyColumn
findForeignTable
class ImmutableForeignKeyColumn extends ImmutableDocument implements ForeignKeyColumn { private final String id; private final String name; private final int ordinalPosition; private final String foreignColumnName; private final String foreignTableName; private final AtomicReference<Immuta...
if (foreignTable.get() == null) { foreignTable.set(ForeignKeyColumn.super.findForeignTable().map(ImmutableTable.class::cast).orElse(null)); } return Optional.ofNullable(foreignTable.get());
711
69
780
<methods>public Stream<T> children(java.lang.String, BiFunction<P,Map<java.lang.String,java.lang.Object>,T>) ,public final Map<java.lang.String,java.lang.Object> getData() ,public final void put(java.lang.String, java.lang.Object) ,public java.lang.String toString() ,public static com.speedment.runtime.config.internal....
speedment_speedment
speedment/runtime-parent/runtime-config/src/main/java/com/speedment/runtime/config/internal/immutable/ImmutableIndexColumn.java
ImmutableIndexColumn
findColumn
class ImmutableIndexColumn extends ImmutableDocument implements IndexColumn { private final String id; private final String name; private final int ordinalPosition; private final OrderType orderType; private final AtomicReference<ImmutableColumn> column; ImmutableIndexColumn(ImmutableIndex par...
if (column.get() == null) { column.set(IndexColumn.super.findColumn().map(ImmutableColumn.class::cast).orElse(null)); } return Optional.ofNullable(column.get());
356
60
416
<methods>public Stream<T> children(java.lang.String, BiFunction<P,Map<java.lang.String,java.lang.Object>,T>) ,public final Map<java.lang.String,java.lang.Object> getData() ,public final void put(java.lang.String, java.lang.Object) ,public java.lang.String toString() ,public static com.speedment.runtime.config.internal....
speedment_speedment
speedment/runtime-parent/runtime-config/src/main/java/com/speedment/runtime/config/internal/immutable/ImmutablePrimaryKeyColumn.java
ImmutablePrimaryKeyColumn
findColumn
class ImmutablePrimaryKeyColumn extends ImmutableDocument implements PrimaryKeyColumn { private final String id; private final String name; private final int ordinalPosition; private final AtomicReference<ImmutableColumn> column; ImmutablePrimaryKeyColumn(ImmutableTable parent, Map<String, Ob...
if (column.get() == null) { column.set(PrimaryKeyColumn.super.findColumn().map(ImmutableColumn.class::cast).orElse(null)); } return Optional.ofNullable(column.get());
331
61
392
<methods>public Stream<T> children(java.lang.String, BiFunction<P,Map<java.lang.String,java.lang.Object>,T>) ,public final Map<java.lang.String,java.lang.Object> getData() ,public final void put(java.lang.String, java.lang.Object) ,public java.lang.String toString() ,public static com.speedment.runtime.config.internal....
speedment_speedment
speedment/runtime-parent/runtime-config/src/main/java/com/speedment/runtime/config/internal/immutable/ImmutableProject.java
ImmutableProject
findTableByName
class ImmutableProject extends ImmutableDocument implements Project { private final boolean enabled; private final String id; private final String name; private final String companyName; private final String packageName; private final String packageLocation; private final Path configPath; ...
final ImmutableTable table = tablesByName.get(fullName); if (table == null) { throw new SpeedmentConfigException( "Unable to find table '" + fullName + "' in immutable config model." ); } return ...
576
77
653
<methods>public Stream<T> children(java.lang.String, BiFunction<P,Map<java.lang.String,java.lang.Object>,T>) ,public final Map<java.lang.String,java.lang.Object> getData() ,public final void put(java.lang.String, java.lang.Object) ,public java.lang.String toString() ,public static com.speedment.runtime.config.internal....
speedment_speedment
speedment/runtime-parent/runtime-config/src/main/java/com/speedment/runtime/config/provider/BaseDocument.java
BaseDocument
getAsLong
class BaseDocument implements Document { private final Document parent; // Nullable private final Map<String, Object> config; public BaseDocument(Document parent, Map<String, Object> data) { this.parent = parent; this.config = requireNonNull(data); } @Override public Optio...
final Number value = (Number) config.get(key); return value == null ? OptionalLong.empty() : OptionalLong.of(value.longValue());
475
47
522
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-config/src/main/java/com/speedment/runtime/config/util/ClassUtil.java
ClassUtil
classFromString
class ClassUtil { /** * Returns the full name of the specified type (including the array brackets * if it is an array class). * * @param clazz class * @return the absolute class name */ public static String classToString(Class<?> clazz) { requireNonNull(clazz, "Class is ...
String inner = className; int dimensions = 0; while (inner.endsWith("[]")) { inner = inner.substring(0, inner.length() - 2); dimensions++; } final Class<?> innerClass; switch (inner) { case "byte": innerClass = byte.class; break; ...
507
291
798
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-config/src/main/java/com/speedment/runtime/config/util/DocumentTranscoder.java
DocumentTranscoder
load
class DocumentTranscoder { private DocumentTranscoder() {} /** * The element name of the root node in the JSON configuration file. Every * setting should be located in this element. */ public static final String ROOT = "config"; /** * A functional interface describing a metho...
requireNonNull(json, "No json value specified."); try { final Map<String, Object> root = decoder.decode(json); @SuppressWarnings("unchecked") final Map<String, Object> data = (Map<String, Object>) root.get(ROOT); ...
958
161
1,119
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-config/src/main/java/com/speedment/runtime/config/util/TraitUtil.java
TraitUtil
viewOf
class TraitUtil { /** * Returns a view of the specified document that implements the specified * trait. The returned document might or might not be the same instance as * was inputted to this method. If not, the instance will be initialized * using the specified constructor. * * ...
if (trait.isInstance(document)) { return trait.cast(document); } else { final Class<? extends Document> mainInterface; if (document instanceof HasMainInterface) { mainInterface = ((HasMainInterface) document).mainInt...
350
131
481
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-connector-parent/postgres/src/main/java/com/speedment/runtime/connector/postgres/internal/PostgresDbmsMetadataHandler.java
PostgresDbmsMetadataHandler
stringRule
class PostgresDbmsMetadataHandler extends AbstractDbmsMetadataHandler { PostgresDbmsMetadataHandler( final ConnectionPoolComponent connectionPoolComponent, final DbmsHandlerComponent dbmsHandlerComponent, final ProjectComponent projectComponent ) { super(connectionPoolComponent,...
return (sqlTypeMapping, md) -> { if (text.equalsIgnoreCase(md.getTypeName()) && md.getDataType() == i) { return Optional.of(String.class); } else return Optional.empty(); };
661
66
727
<methods>public java.lang.String getDbmsInfoString(com.speedment.runtime.config.Dbms) throws java.sql.SQLException,public CompletableFuture<com.speedment.runtime.config.Project> readSchemaMetadata(com.speedment.runtime.config.Dbms, com.speedment.runtime.core.util.ProgressMeasure, Predicate<java.lang.String>) <variables...
speedment_speedment
speedment/runtime-parent/runtime-connector-parent/postgres/src/main/java/com/speedment/runtime/connector/postgres/internal/PostgresDbmsOperationHandler.java
PostgresDbmsOperationHandler
generatedKeysHandler
class PostgresDbmsOperationHandler implements DbmsOperationHandler { private static final int FETCH_SIZE = 4096; // Five elements - list is surely more efficient than a hash set private static final List<Integer> LONG_GETTABLE_TYPES = Arrays.asList( Types.TINYINT, Types.SMALLINT, ...
/* * There does not seem to be any way to find the generated keys from a Postgres JDBC driver * since getGeneratedKeys() returns the whole set of columns. This causes * bug #293 "The postgresql throws an exception when the PRIMARY KEY is not type long." * * See http...
1,042
261
1,303
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-connector-parent/sqlite/src/main/java/com/speedment/runtime/connector/sqlite/internal/SqliteFieldPredicateView.java
SqliteFieldPredicateView
startsWithIgnoreCaseHelper
class SqliteFieldPredicateView extends AbstractFieldPredicateView { @Override protected SqlPredicateFragment equalHelper(String cn, Object argument) { return of("(" + cn + " = ?)").add(argument); } @Override protected SqlPredicateFragment notEqualHelper(String cn, Object argument) { ...
return of("(" + cn + " COLLATE NOCASE LIKE (? || \"%\") ESCAPE \"_\")", negated) .add(getFirstOperandAsRaw(model));
646
53
699
<methods>public non-sealed void <init>() ,public com.speedment.runtime.core.db.SqlPredicateFragment transform(Function<Field<ENTITY>,java.lang.String>, Function<Field<ENTITY>,Class<?>>, FieldPredicate<ENTITY>) <variables>private static final java.lang.String GREATER_OR_EQUAL_WILDCARD,private static final java.lang.Stri...
speedment_speedment
speedment/runtime-parent/runtime-connector-parent/sqlite/src/main/java/com/speedment/runtime/connector/sqlite/internal/types/SqlTypeMappingHelperImpl.java
SqlTypeMappingHelperImpl
readTypeMapFromDB
class SqlTypeMappingHelperImpl implements SqlTypeMappingHelper { private final ConnectionPoolComponent connectionPool; private final DbmsHandlerComponent dbmsHandler; private final JavaTypeMap javaTypeMap; SqlTypeMappingHelperImpl( final ConnectionPoolComponent connectionPool, final Db...
requireNonNull(dbms); final List<TypeInfoMetaData> typeInfoMetaDataList = new ArrayList<>(); try (final Connection connection = connectionPool.getConnection(dbms)) { try (final ResultSet rs = connection.getMetaData().getTypeInfo()) { while (rs.next()) { ...
857
137
994
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/abstracts/AbstractDatabaseNamingConvention.java
AbstractDatabaseNamingConvention
escapeIfQuote
class AbstractDatabaseNamingConvention implements DatabaseNamingConvention { private static final String DEFAULT_DELIMITER = "."; private static final String DEFAULT_QUOTE = "'"; @Override public String fullNameOf(String schemaName, String tableName, String columnName) { return fullNameOf(sche...
if (isWithinQuotes && "\"".equals(item)) { return "\\" + item; } else { return item; }
1,189
43
1,232
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/ManagerComponentImpl.java
ManagerComponentImpl
managerOf
class ManagerComponentImpl implements ManagerComponent { private final Map<Class<?>, Manager<?>> managersByEntity; public ManagerComponentImpl() { managersByEntity = new ConcurrentHashMap<>(); } @Override public <ENTITY> void put(Manager<ENTITY> manager) { requireNonNull(manager);...
requireNonNull(entityClass); @SuppressWarnings("unchecked") final Manager<E> manager = (Manager<E>) managersByEntity.get(entityClass); if (manager == null) { throw new SpeedmentException( "No manager exists for " + enti...
187
98
285
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/PasswordComponentImpl.java
PasswordComponentImpl
get
class PasswordComponentImpl implements PasswordComponent { private final Map<String, char[]> passwords; public PasswordComponentImpl() { this.passwords = new ConcurrentHashMap<>(); } @Override public void put(String dbmsName, char[] password) { requireNonNull(dbmsName); if...
requireNonNull(dbmsName); final char[] value = passwords.get(dbmsName); if (value == null) { return Optional.empty(); } else { return Optional.of(value); }
163
62
225
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/StatisticsReporterSchedulerComponentImpl.java
StatisticsReporterSchedulerComponentImpl
guardedCall
class StatisticsReporterSchedulerComponentImpl implements StatisticsReporterSchedulerComponent { private static final Logger LOGGER = LoggerManager.getLogger(StatisticsReporterSchedulerComponentImpl.class); private final AtomicBoolean outstanding; private final boolean enabled; private final Scheduled...
if (outstanding.compareAndSet(false,true)) { try { r.run(); } finally { outstanding.set(false); } }
520
49
569
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/resultset/ResultSetMapperComponentImpl.java
ResultSetMapperComponentImpl
apply
class ResultSetMapperComponentImpl implements ResultSetMapperComponent { private final Map<Class<?>, ResultSetMapping<?>> map; private final Map<DbmsType, Map<Class<?>, ResultSetMapping<?>>> dbmsTypeMap; public ResultSetMapperComponentImpl() { map = newConcurrentMap(); dbmsTypeMap ...
requireNonNulls(dbmsType, javaClass); return getFromMapOrThrow(dbmsTypeMap.getOrDefault(dbmsType, map), javaClass, () -> dbmsType + ", " + javaClass.getName());
533
59
592
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/sql/MetricsImpl.java
MetricsImpl
equals
class MetricsImpl implements Metrics { public static final Metrics EMPTY_INSTANCE = new MetricsImpl(0, 0, 0, 0, 0); private final int pipelineReductions; private final int sqlWhileCount; private final int sqlOrderCount; private final int sqlSkipCount; private final int sqlLimitCount; publ...
if (obj == this) { return true; } if (!(obj instanceof Metrics)) { return false; } final Metrics that = (Metrics) obj; return this.getPipelineReductions() == that.getPipelineReductions() && this.getSqlWhileCount() == that.getSqlWhileCo...
586
145
731
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/sql/SqlPersistenceComponentImpl.java
SqlPersistenceComponentImpl
persistenceProvider
class SqlPersistenceComponentImpl implements SqlPersistenceComponent { private final ProjectComponent projectComponent; private final DbmsHandlerComponent dbmsHandlerComponent; private final ManagerComponent managerComponent; private final ResultSetMapperComponent resultSetMapperComponent; public ...
return new SqlPersistenceProviderImpl<>( tableInfo, projectComponent, dbmsHandlerComponent, managerComponent, resultSetMapperComponent );
229
45
274
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/sql/SqlStreamOptimizerComponentImpl.java
SqlStreamOptimizerComponentImpl
get
class SqlStreamOptimizerComponentImpl implements SqlStreamOptimizerComponent { private static final Logger LOGGER_STREAM_OPTIMIZER = LoggerManager.getLogger(ApplicationBuilder.LogType.STREAM_OPTIMIZER.getLoggerName()); private static final SqlStreamOptimizer<?> FALL_BACK = new FallbackStreamOptimizer<>(); ...
if (DEBUG.isEqualOrHigherThan(LOGGER_STREAM_OPTIMIZER.getLevel())) { LOGGER_STREAM_OPTIMIZER.debug("Evaluating %s pipeline: %s", initialPipeline.isParallel() ? "parallel" : "sequential", initialPipeline.toString()); } final SqlStreamOptimizer<ENTITY> result = getHelper(initialPipeli...
849
180
1,029
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/sql/SqlStreamSupplierComponentImpl.java
SqlStreamSupplierComponentImpl
startStreamSuppliers
class SqlStreamSupplierComponentImpl implements SqlStreamSupplierComponent { private final Map<TableIdentifier<?>, SqlStreamSupplier<?>> supportMap; private final boolean allowStreamIteratorAndSpliterator; public SqlStreamSupplierComponentImpl( @Config(name = "allowStreamIteratorAndSpliterator", v...
// the trace component is optional final SqlTraceComponent sqlTraceComponent = injector.get(SqlTraceComponent.class).orElse(null); injector.stream(SqlAdapter.class) .forEach(sa -> { final SqlStreamSupplier<Object> supplier = new SqlStreamSupplierImpl<>( ...
432
179
611
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/sql/SqlStreamSupplierImpl.java
SqlStreamSupplierImpl
stream
class SqlStreamSupplierImpl<ENTITY> implements SqlStreamSupplier<ENTITY> { private static final Logger LOGGER_SELECT = LoggerManager.getLogger(ApplicationBuilder.LogType.STREAM.getLoggerName()); // Hold an extra reference to this logger private final SqlFunction<ResultSet, ENTITY> entityMapper; private fi...
final AsynchronousQueryResult<ENTITY> asynchronousQueryResult = dbmsType.getOperationHandler().executeQueryAsync( dbms, sqlSelect, Collections.emptyList(), entityMapper, parallelStrategy ); final Sq...
1,369
325
1,694
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/sql/SqlTracerImpl.java
SqlTracerImpl
attachTraceData
class SqlTracerImpl implements SqlTracer { private final SqlTraceComponent sqlTraceComponent; SqlTracerImpl(final SqlTraceComponent sqlTraceComponent) { this.sqlTraceComponent = sqlTraceComponent; } @Override public String attachTraceData(final String sql) {<FILL_FUNCTION_BODY>} }
if (sqlTraceComponent == null || sqlTraceComponent.getComment() == null || sqlTraceComponent.getCommentStyle() == null) { return sql; } final String comment = sqlTraceComponent.getComment(); final DatabaseCommentStyle commentStyle = sqlTraceComponent...
87
145
232
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/sql/override/def/doubles/DefaultDoubleCountTerminator.java
DefaultDoubleCountTerminator
apply
class DefaultDoubleCountTerminator<ENTITY> implements DoubleCountTerminator<ENTITY> { private DefaultDoubleCountTerminator() { } @Override public long apply( final SqlStreamOptimizerInfo<ENTITY> info, final SqlStreamTerminator<ENTITY> sqlStreamTerminator, final DoublePipeline p...
requireNonNull(info); requireNonNull(sqlStreamTerminator); requireNonNull(pipeline); final DoublePipeline optimizedPipeline = sqlStreamTerminator.optimize(pipeline); return sqlStreamTerminator .attachTraceData(optimizedPipeline) .getAsDoubleStream().coun...
133
86
219
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/sql/override/def/longs/DefaultLongCountTerminator.java
DefaultLongCountTerminator
apply
class DefaultLongCountTerminator<ENTITY> implements LongCountTerminator<ENTITY> { private DefaultLongCountTerminator() { } @Override public long apply( final SqlStreamOptimizerInfo<ENTITY> info, final SqlStreamTerminator<ENTITY> sqlStreamTerminator, final LongPipeline p...
requireNonNull(info); requireNonNull(sqlStreamTerminator); requireNonNull(pipeline); final LongPipeline optimizedPipeline = sqlStreamTerminator.optimize(pipeline); return sqlStreamTerminator .attachTraceData(optimizedPipeline) .getAsLongStream().count();...
134
86
220
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/sql/override/def/reference/DefaultAllMatchTerminator.java
DefaultAllMatchTerminator
apply
class DefaultAllMatchTerminator<ENTITY> implements AllMatchTerminator<ENTITY> { private DefaultAllMatchTerminator() { } @Override public <T> boolean apply( final SqlStreamOptimizerInfo<ENTITY> info, final SqlStreamTerminator<ENTITY> sqlStreamTerminator, final ReferencePipeline<...
requireNonNull(info); requireNonNull(sqlStreamTerminator); requireNonNull(pipeline); requireNonNull(predicate); final ReferencePipeline<T> optimizedPipeline = sqlStreamTerminator.optimize(pipeline); return sqlStreamTerminator .attachTraceData(optimizedPipeli...
151
102
253
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/sql/override/def/reference/DefaultCollectTerminator.java
DefaultCollectTerminator
apply
class DefaultCollectTerminator<ENTITY> implements CollectTerminator<ENTITY> { private DefaultCollectTerminator() { } @Override public <T, R, A> R apply( final SqlStreamOptimizerInfo<ENTITY> info, final SqlStreamTerminator<ENTITY> sqlStreamTerminator, final ReferencePipeline<T> ...
requireNonNull(info); requireNonNull(sqlStreamTerminator); requireNonNull(pipeline); requireNonNull(collector); final ReferencePipeline<T> optimizedPipeline = sqlStreamTerminator.optimize(pipeline); return sqlStreamTerminator .attachTraceData(optimizedPipeli...
154
101
255
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/sql/override/def/reference/DefaultFindAnyTerminator.java
DefaultFindAnyTerminator
apply
class DefaultFindAnyTerminator<ENTITY> implements FindAnyTerminator<ENTITY> { private DefaultFindAnyTerminator() { } @Override public <T> Optional<T> apply( final SqlStreamOptimizerInfo<ENTITY> info, final SqlStreamTerminator<ENTITY> sqlStreamTerminator, final ReferencePipeline...
requireNonNull(info); requireNonNull(sqlStreamTerminator); requireNonNull(pipeline); final ReferencePipeline<T> optimizedPipeline = sqlStreamTerminator.optimize(pipeline); return sqlStreamTerminator .attachTraceData(optimizedPipeline) .getAsReferenceStre...
142
90
232
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/sql/override/def/reference/DefaultMaxTerminator.java
DefaultMaxTerminator
apply
class DefaultMaxTerminator<ENTITY> implements MaxTerminator<ENTITY> { private DefaultMaxTerminator() { } @Override public <T> Optional<T> apply( final SqlStreamOptimizerInfo<ENTITY> info, final SqlStreamTerminator<ENTITY> sqlStreamTerminator, final ReferencePipeline<T> pipeline...
requireNonNull(info); requireNonNull(sqlStreamTerminator); requireNonNull(pipeline); requireNonNull(comparator); final ReferencePipeline<T> optimizedPipeline = sqlStreamTerminator.optimize(pipeline); return sqlStreamTerminator .attachTraceData(optimizedPipel...
151
103
254
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/sql/override/def/reference/DefaultMinTerminator.java
DefaultMinTerminator
apply
class DefaultMinTerminator<ENTITY> implements MinTerminator<ENTITY> { private DefaultMinTerminator() { } @Override public <T> Optional<T> apply( final SqlStreamOptimizerInfo<ENTITY> info, final SqlStreamTerminator<ENTITY> sqlStreamTerminator, final ReferencePipeline<T> pipeline...
requireNonNull(info); requireNonNull(sqlStreamTerminator); requireNonNull(pipeline); requireNonNull(comparator); final ReferencePipeline<T> optimizedPipeline = sqlStreamTerminator.optimize(pipeline); return sqlStreamTerminator .attachTraceData(optimizedPipel...
151
103
254
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/sql/override/def/reference/DefaultNoneMatchTerminator.java
DefaultNoneMatchTerminator
apply
class DefaultNoneMatchTerminator<ENTITY> implements NoneMatchTerminator<ENTITY> { private DefaultNoneMatchTerminator() { } @Override public <T> boolean apply( final SqlStreamOptimizerInfo<ENTITY> info, final SqlStreamTerminator<ENTITY> sqlStreamTerminator, final ReferencePipeli...
requireNonNull(info); requireNonNull(sqlStreamTerminator); requireNonNull(pipeline); requireNonNull(predicate); final ReferencePipeline<T> optimizedPipeline = sqlStreamTerminator.optimize(pipeline); return sqlStreamTerminator .attachTraceData(optimizedPipeli...
151
102
253
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/sql/override/def/reference/DefaultReduceIdentityCombinerTerminator.java
DefaultReduceIdentityCombinerTerminator
apply
class DefaultReduceIdentityCombinerTerminator<ENTITY> implements ReduceIdentityCombinerTerminator<ENTITY> { private DefaultReduceIdentityCombinerTerminator() { } @Override public <T, U> U apply( final SqlStreamOptimizerInfo<ENTITY> info, final SqlStreamTerminator<ENTITY> sqlStreamTermi...
requireNonNull(info); requireNonNull(sqlStreamTerminator); requireNonNull(pipeline); // identity nullable requireNonNull(accumulator); requireNonNull(combiner); final ReferencePipeline<T> optimizedPipeline = sqlStreamTerminator.optimize(pipeline); return...
196
124
320
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/sql/override/def/reference/DefaultReduceIdentityTerminator.java
DefaultReduceIdentityTerminator
apply
class DefaultReduceIdentityTerminator<ENTITY> implements ReduceIdentityTerminator<ENTITY> { private DefaultReduceIdentityTerminator() { } @Override public <T> T apply( final SqlStreamOptimizerInfo<ENTITY> info, final SqlStreamTerminator<ENTITY> sqlStreamTerminator, fina...
requireNonNull(info); requireNonNull(sqlStreamTerminator); requireNonNull(pipeline); // identity nullable requireNonNull(accumulator); final ReferencePipeline<T> optimizedPipeline = sqlStreamTerminator.optimize(pipeline); return sqlStreamTerminator ....
163
111
274
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/sql/override/def/reference/DefaultToArrayGeneratorTerminator.java
DefaultToArrayGeneratorTerminator
apply
class DefaultToArrayGeneratorTerminator<ENTITY> implements ToArrayGeneratorTerminator<ENTITY> { private DefaultToArrayGeneratorTerminator() { } @Override public <T, A> A[] apply( final SqlStreamOptimizerInfo<ENTITY> info, final SqlStreamTerminator<ENTITY> sqlStreamTerminator, ...
requireNonNull(info); requireNonNull(sqlStreamTerminator); requireNonNull(pipeline); requireNonNull(generator); final ReferencePipeline<T> optimizedPipeline = sqlStreamTerminator.optimize(pipeline); return sqlStreamTerminator .attachTraceData(optimizedPipeli...
159
100
259
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/sql/override/def/reference/DefaultToArrayTerminator.java
DefaultToArrayTerminator
apply
class DefaultToArrayTerminator<ENTITY> implements ToArrayTerminator<ENTITY> { private DefaultToArrayTerminator() { } @Override public <T> Object[] apply( final SqlStreamOptimizerInfo<ENTITY> info, final SqlStreamTerminator<ENTITY> sqlStreamTerminator, final ReferencePipeline<T>...
requireNonNull(info); requireNonNull(sqlStreamTerminator); requireNonNull(pipeline); final ReferencePipeline<T> optimizedPipeline = sqlStreamTerminator.optimize(pipeline); return sqlStreamTerminator .attachTraceData(optimizedPipeline) .getAsReferenceStre...
140
90
230
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/sql/override/optimized/ints/OptimizedIntCountTerminator.java
OptimizedIntCountTerminator
apply
class OptimizedIntCountTerminator<ENTITY> implements IntCountTerminator<ENTITY> { private OptimizedIntCountTerminator() {} @Override public long apply( final SqlStreamOptimizerInfo<ENTITY> info, final SqlStreamTerminator<ENTITY> sqlStreamTerminator, final IntPipeline pipeline )...
requireNonNull(info); requireNonNull(sqlStreamTerminator); requireNonNull(pipeline); return countHelper( info, sqlStreamTerminator, pipeline, () -> IntCountTerminator.<ENTITY>defaultTerminator().apply(info, sqlStreamTerminator, pipeline) ...
189
89
278
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/sql/override/optimized/reference/OptimizedCountTerminator.java
OptimizedCountTerminator
apply
class OptimizedCountTerminator<ENTITY> implements CountTerminator<ENTITY> { private OptimizedCountTerminator() { } @Override public <T> long apply( final SqlStreamOptimizerInfo<ENTITY> info, final SqlStreamTerminator<ENTITY> sqlStreamTerminator, final ReferencePipeline<T> pipel...
requireNonNull(info); requireNonNull(sqlStreamTerminator); requireNonNull(pipeline); return countHelper( info, sqlStreamTerminator, pipeline, () -> CountTerminator.<ENTITY>defaultTerminator().apply(info, sqlStreamTerminator, pipeline) ...
191
88
279
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/sql/override/optimized/util/CountUtil.java
CountUtil
countHelper
class CountUtil { private static final Predicate<Action<?, ?>> PRESERVE_SIZE = action -> action.is(PRESERVE, SIZE); /** * Optimizer for count operations. * * @param <ENTITY> the entity type * @param info about the stream optimizer * @param sqlStreamTerminator that called us * @pa...
requireNonNull(info); requireNonNull(sqlStreamTerminator); requireNonNull(pipeline); requireNonNull(fallbackSupplier); // Can we count it directly (with no sub-select query)? if (pipeline.stream().allMatch(PRESERVE_SIZE)) { return info.getCounter().applyAsLo...
235
375
610
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/transaction/TransactionHandlerImpl.java
TransactionHandlerImpl
createAndApply
class TransactionHandlerImpl implements TransactionHandler { private static final Logger TRANSACTION_LOGGER = LoggerManager.getLogger(ApplicationBuilder.LogType.TRANSACTION.getLoggerName()); private final TransactionComponent txComponent; private final Object dataSource; private final DataSourceHandle...
requireNonNull(mapper); final Thread currentThread = Thread.currentThread(); final Object txObject = dataSourceHandler.extractor().apply(dataSource); // e.g. obtains a Connection final Isolation oldIsolation = setAndGetIsolation(txObject, isolation); final Transaction tx = new T...
361
379
740
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/db/DriverComponentImpl.java
DriverComponentImpl
driverHelper
class DriverComponentImpl implements DriverComponent { // Driver names are cached because getting a Driver // is expensive and is called within the get connection loop // in the ConnectionPoolComponent, // See https://github.com/speedment/speedment/issues/725 // And yes, we should not put Optionals...
requireNonNull(driverName); Driver driver = null; try { final Class<?> driverClass = Class.forName( driverName, true, injector.classLoader() ); if (Driver.class.isAssignableFrom(driverClass)) { d...
250
305
555
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/db/JavaTypeMapImpl.java
JavaTypeMapImpl
findJdbcType
class JavaTypeMapImpl implements JavaTypeMap { private final List<Rule> rules; private final Map<String, Class<?>> inner; public JavaTypeMapImpl() { this(map -> {}); } /** * Sets up the java type map for this database type * * @param installer the installer *...
// Firstly, check if we have any rule for this type. final Optional<Class<?>> ruled = rules.stream() .map(r -> r.findJdbcType(sqlTypeMapping, md)) .filter(Optional::isPresent) .map(Optional::get) .findFirst(); if (ruled.isPresent()) { ...
1,011
370
1,381
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/db/SqlQueryLoggerUtil.java
SqlQueryLoggerUtil
logOperation
class SqlQueryLoggerUtil { private SqlQueryLoggerUtil() {} public static void logOperation(Logger logger, final String sql, final List<?> values) {<FILL_FUNCTION_BODY>} }
if (logger.getLevel().isEqualOrLowerThan(Level.DEBUG)) { final String text = sql + " " + values.stream() .map(o -> o == null ? "null" : o.getClass().getSimpleName() + " " + o.toString()) .collect(Collect...
55
105
160
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/db/metadata/ColumnMetaDataImpl.java
IntHolder
readSilent
class IntHolder { private final int value; private final boolean isNull; IntHolder(ResultSet rs, SqlIntSupplier supplier) { int val = 0; boolean isValueNull= true; try { val = supplier.get(); isValueNull = rs.wasNull(); ...
try { final T result = supplier.get(); if (rs.wasNull()) { return null; } else { return result; } } catch (SQLException sqle) { // ignore, just return null if (fullWarning) { LOGGER.w...
310
131
441
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/db/metadata/TypeInfoMetaDataImpl.java
TypeInfoMetaDataImpl
toString
class TypeInfoMetaDataImpl implements TypeInfoMetaData { //http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getTypeInfo() private final String sqlTypeName; private final int javaSqlTypeInt; private final int precision; private final int decimals; private final short nulla...
return getSqlTypeName() + " " + (isUnsigned() ? "UNSIGNED" : "") + " " + getPrecision() + " " + getDecimals() + " " + (isNullable() ? "NULL" : "") + " " + (isNoNulls() ? "NOT NULL" : "") + " (" + getJavaSqlTypeInt()...
652
106
758
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/manager/ConfiguredManager.java
ConfiguredManager
toString
class ConfiguredManager<ENTITY> implements Manager<ENTITY> { private final StreamSupplierComponent streamSupplierComponent; private final Manager<ENTITY> manager; private final ParallelStrategy parallelStrategy; ConfiguredManager(StreamSupplierComponent streamSupplierComponent, M...
return "ConfiguredManager{" + "manager=" + manager + ", parallelStrategy=" + parallelStrategy + '}';
522
38
560
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/stream/autoclose/AutoClosingIntStream.java
AutoClosingIntStream
toArray
class AutoClosingIntStream extends AbstractAutoClosingStream<Integer, IntStream> implements IntStream, Java9IntStreamAdditions { AutoClosingIntStream( final IntStream stream, final boolean allowStreamIteratorAndSpliterator ) { super(stream, allowStreamIteratorAndSpliterator); ...
try { return stream().toArray(); } finally { stream().close(); }
1,460
29
1,489
<methods>public void close() <variables>private final non-sealed boolean allowStreamIteratorAndSpliterator,private final non-sealed java.util.concurrent.atomic.AtomicBoolean closed,private final non-sealed java.util.stream.IntStream stream
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/stream/autoclose/AutoClosingLongStream.java
AutoClosingLongStream
toArray
class AutoClosingLongStream extends AbstractAutoClosingStream<Long, LongStream> implements LongStream, Java9LongStreamAdditions { AutoClosingLongStream( final LongStream stream, final boolean allowStreamIteratorAndSpliterator ) { super(stream, allowStreamIteratorAndSpliterator);...
try { return stream().toArray(); } finally { close(); }
1,431
27
1,458
<methods>public void close() <variables>private final non-sealed boolean allowStreamIteratorAndSpliterator,private final non-sealed java.util.concurrent.atomic.AtomicBoolean closed,private final non-sealed java.util.stream.LongStream stream
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/stream/builder/AbstractStreamBuilder.java
AbstractStreamBuilder
pipeline
class AbstractStreamBuilder<T extends AbstractStreamBuilder<T, P>, P> { private static final Logger LOGGER = LoggerManager.getLogger(AbstractStreamBuilder.class); protected final PipelineImpl<?> pipeline; protected final StreamTerminator streamTerminator; protected final Set<BaseStream<?, ?>> streamSe...
@SuppressWarnings("unchecked") final P result = (P) pipeline; return result;
1,123
31
1,154
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/stream/builder/streamterminator/StreamTerminatorUtil.java
RenderResultImpl
renderSqlWhereHelper
class RenderResultImpl implements RenderResult { private final String sql; private final List<Object> values; RenderResultImpl(String sql, List<Object> values /*, Pipeline pipeline*/) { this.sql = sql; this.values = values; } @Override public St...
if (predicate instanceof FieldPredicate) { final FieldPredicate<ENTITY> fieldPredicate = (FieldPredicate<ENTITY>) predicate; final SqlPredicateFragment fragment = spv.transform(columnNamer, columnDbTypeFunction, fieldPredicate); final Field<ENTITY> referenceFieldTrait = fiel...
599
461
1,060
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/stream/parallel/ArraySpliterator.java
ArraySpliterator
forEachRemaining
class ArraySpliterator<T> implements Spliterator<T> { private final Object[] array; private final int size; private final int characteristics; private int index; /** * Creates a {@link Spliterator} covering all of the given array. * * @param array the array, assumed to be unmodified...
requireNonNull(action); int i; int hi; if (array.length >= (hi = size) && (i = index) >= 0 && i < (index = hi)) { do { action.accept((T) array[i]); } while (++i < hi); }
732
80
812
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/util/Cast.java
Cast
castOrFail
class Cast { private Cast() {} /** * Casts and returns the provided object if it is assignable from the given * class, otherwise returns an Optional.empty(). * * @param <T> the type to return * @param object to cast * @param clazz to cast to * @return An Optional of the cast...
requireNonNull(clazz); if (object == null) { throw new NoSuchElementException("null is not an instance of " + clazz.getName()); } return Optional.of(object) .filter(o -> clazz.isAssignableFrom(o.getClass())) .map(clazz::cast) .orElseThrow(...
330
102
432
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/util/InternalEmailUtil.java
InternalEmailUtil
getUserId
class InternalEmailUtil { private InternalEmailUtil() {} private static final String ID_FIELD_NAME = "user_id"; private static final String EMAIL_FIELD_NAME = "user_mail"; private static final String DEFAULT_EMAIL = "no-mail-specified"; private static final Preferences PREFERENCES = ...
final String id = PREFERENCES.get(ID_FIELD_NAME, ""); try { return UUID.fromString(id); } catch (final IllegalArgumentException ex) { final UUID generated = UUID.randomUUID(); PREFERENCES.put(ID_FIELD_NAME, generated.toString()); return generated;...
327
89
416
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/stream/ComposeRunnableUtil.java
ComposeRunnableUtil
composedRunnable
class ComposeRunnableUtil { private ComposeRunnableUtil() {} /** * Given a number of streams, closes the streams in sequence, even if one or * several throws an Exception. If several throw exceptions, the exceptions * will be added to the first exception. * * @param <T> Stream type ...
requireNonNullElements(runnables); final AutoCloseable[] closables = new AutoCloseable[runnables.size()]; int i = 0; for (final Runnable r : runnables) { closables[i++] = new CloseImpl(r); } composedClose(closables);
513
84
597
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/util/OptionalUtil.java
OptionalUtil
ofNullable
class OptionalUtil { private OptionalUtil() {} /** * If the specified object is an {@code Optional}, the inner value will be * returned. Otherwise, the object is returned directly. * * @param potentiallyOptional the object that might be an {@code Optional} * @return ...
if (i == null) { return OptionalInt.empty(); } else { return OptionalInt.of(i); }
1,704
38
1,742
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/util/Statistics.java
Statistics
report
class Statistics { private static final String HOST_NAME = computerName(); private static final long STARTED = Instant.now(Clock.system(ZoneId.of("UTC"))).getEpochSecond(); private Statistics() {} public enum Event { GUI_STARTED ("gui-started"), GUI_PROJECT_LOADED ("gui-projec...
requireNonNull(info); requireNonNull(projects); requireNonNull(event); if (TestSettings.isTestMode()) { return; } final Project project = projects.getProject(); final Map<String, Object> ping = new HashMap<>(); ping.put("userId", InternalE...
828
263
1,091
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/util/StreamComposition.java
StreamComposition
configureAutoCloseStream
class StreamComposition { private StreamComposition() {} /** * Creates a lazily concatenated Stream whose elements are are all the * elements of the streams in sequential order. The resulting Stream is * ordered if all of the input streams are ordered, and parallel if at least * one of the...
@SuppressWarnings("rawtypes") final boolean parallel = Stream.of(streams).anyMatch(BaseStream::isParallel); // T:::isParallel gives IDE warning if (parallel) { concatStream.parallel(); } concatStream.onClose(() -> composedClose(streams)); return concatStream;...
934
90
1,024
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/ByteFieldImpl.java
ByteFieldImpl
tableAlias
class ByteFieldImpl<ENTITY, D> implements ByteField<ENTITY, D> { private final ColumnIdentifier<ENTITY> identifier; private final GetByte<ENTITY, D> getter; private final ByteSetter<ENTITY> setter; private final TypeMapper<D, Byte> typeMapper; private final boolean unique; private final Str...
requireNonNull(tableAlias); return new ByteFieldImpl<>(identifier, getter, setter, typeMapper, unique, tableAlias);
1,238
39
1,277
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/DoubleForeignKeyFieldImpl.java
DoubleForeignKeyFieldImpl
tableAlias
class DoubleForeignKeyFieldImpl<ENTITY, D, FK_ENTITY> implements DoubleField<ENTITY, D>, DoubleForeignKeyField<ENTITY, D, FK_ENTITY> { private final ColumnIdentifier<ENTITY> identifier; private final GetDouble<ENTITY, D> getter; private final DoubleSetter<ENTITY> setter; private final DoubleField<F...
requireNonNull(tableAlias); return new DoubleForeignKeyFieldImpl<>(identifier, getter, setter, referenced, typeMapper, unique, tableAlias);
1,538
44
1,582
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/FloatFieldImpl.java
FloatFieldImpl
tableAlias
class FloatFieldImpl<ENTITY, D> implements FloatField<ENTITY, D> { private final ColumnIdentifier<ENTITY> identifier; private final GetFloat<ENTITY, D> getter; private final FloatSetter<ENTITY> setter; private final TypeMapper<D, Float> typeMapper; private final boolean unique; private fina...
requireNonNull(tableAlias); return new FloatFieldImpl<>(identifier, getter, setter, typeMapper, unique, tableAlias);
1,271
40
1,311
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/FloatForeignKeyFieldImpl.java
FloatForeignKeyFieldImpl
tableAlias
class FloatForeignKeyFieldImpl<ENTITY, D, FK_ENTITY> implements FloatField<ENTITY, D>, FloatForeignKeyField<ENTITY, D, FK_ENTITY> { private final ColumnIdentifier<ENTITY> identifier; private final GetFloat<ENTITY, D> getter; private final FloatSetter<ENTITY> setter; private final FloatField<FK_ENTI...
requireNonNull(tableAlias); return new FloatForeignKeyFieldImpl<>(identifier, getter, setter, referenced, typeMapper, unique, tableAlias);
1,576
45
1,621
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/IntForeignKeyFieldImpl.java
IntForeignKeyFieldImpl
tableAlias
class IntForeignKeyFieldImpl<ENTITY, D, FK_ENTITY> implements IntField<ENTITY, D>, IntForeignKeyField<ENTITY, D, FK_ENTITY> { private final ColumnIdentifier<ENTITY> identifier; private final GetInt<ENTITY, D> getter; private final IntSetter<ENTITY> setter; private final IntField<FK_ENTITY, D> refer...
requireNonNull(tableAlias); return new IntForeignKeyFieldImpl<>(identifier, getter, setter, referenced, typeMapper, unique, tableAlias);
1,538
44
1,582
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/LongFieldImpl.java
LongFieldImpl
tableAlias
class LongFieldImpl<ENTITY, D> implements LongField<ENTITY, D> { private final ColumnIdentifier<ENTITY> identifier; private final GetLong<ENTITY, D> getter; private final LongSetter<ENTITY> setter; private final TypeMapper<D, Long> typeMapper; private final boolean unique; private final Str...
requireNonNull(tableAlias); return new LongFieldImpl<>(identifier, getter, setter, typeMapper, unique, tableAlias);
1,238
39
1,277
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/LongForeignKeyFieldImpl.java
LongForeignKeyFieldImpl
tableAlias
class LongForeignKeyFieldImpl<ENTITY, D, FK_ENTITY> implements LongField<ENTITY, D>, LongForeignKeyField<ENTITY, D, FK_ENTITY> { private final ColumnIdentifier<ENTITY> identifier; private final GetLong<ENTITY, D> getter; private final LongSetter<ENTITY> setter; private final LongField<FK_ENTITY, D>...
requireNonNull(tableAlias); return new LongForeignKeyFieldImpl<>(identifier, getter, setter, referenced, typeMapper, unique, tableAlias);
1,538
44
1,582
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/ShortFieldImpl.java
ShortFieldImpl
tableAlias
class ShortFieldImpl<ENTITY, D> implements ShortField<ENTITY, D> { private final ColumnIdentifier<ENTITY> identifier; private final GetShort<ENTITY, D> getter; private final ShortSetter<ENTITY> setter; private final TypeMapper<D, Short> typeMapper; private final boolean unique; private fina...
requireNonNull(tableAlias); return new ShortFieldImpl<>(identifier, getter, setter, typeMapper, unique, tableAlias);
1,238
39
1,277
<no_super_class>
speedment_speedment
speedment/runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/comparator/BooleanFieldComparatorImpl.java
BooleanFieldComparatorImpl
applyReversed
class BooleanFieldComparatorImpl<ENTITY, D> extends AbstractFieldComparator<ENTITY> implements BooleanFieldComparator<ENTITY, D> { private final HasBooleanValue<ENTITY, D> field; private final boolean reversed; public BooleanFieldComparatorImpl(HasBooleanValue<ENTITY, D> field) { this(field, false...
if (compare == 0) { return 0; } else { if (reversed) { if (compare > 0) { return -1; } else { return 1; } } else { if (compare > 0) { return 1;...
618
101
719
<methods>public Comparator<ENTITY> thenComparing(Comparator<? super ENTITY>) ,public Comparator<ENTITY> thenComparing(Function<? super ENTITY,? extends U>, Comparator<? super U>) ,public Comparator<ENTITY> thenComparing(Function<? super ENTITY,? extends U>) ,public Comparator<ENTITY> thenComparingDouble(ToDoubleFunctio...
speedment_speedment
speedment/runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/comparator/ByteFieldComparatorImpl.java
ByteFieldComparatorImpl
compare
class ByteFieldComparatorImpl<ENTITY, D> extends AbstractFieldComparator<ENTITY> implements ByteFieldComparator<ENTITY, D> { private final HasByteValue<ENTITY, D> field; private final boolean reversed; public ByteFieldComparatorImpl(HasByteValue<ENTITY, D> field) { this(field, false); ...
requireNonNulls(first, second); final byte a = field.getAsByte(first); final byte b = field.getAsByte(second); return applyReversed(Byte.compare(a, b));
675
58
733
<methods>public Comparator<ENTITY> thenComparing(Comparator<? super ENTITY>) ,public Comparator<ENTITY> thenComparing(Function<? super ENTITY,? extends U>, Comparator<? super U>) ,public Comparator<ENTITY> thenComparing(Function<? super ENTITY,? extends U>) ,public Comparator<ENTITY> thenComparingDouble(ToDoubleFunctio...
speedment_speedment
speedment/runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/comparator/CharFieldComparatorImpl.java
CharFieldComparatorImpl
equals
class CharFieldComparatorImpl<ENTITY, D> extends AbstractFieldComparator<ENTITY> implements CharFieldComparator<ENTITY, D> { private final HasCharValue<ENTITY, D> field; private final boolean reversed; public CharFieldComparatorImpl(HasCharValue<ENTITY, D> field) { this(field, false); ...
if (this == obj) return true; if (!(obj instanceof FieldComparator)) return false; @SuppressWarnings("unchecked") final FieldComparator<ENTITY> casted = (FieldComparator<ENTITY>) obj; return reversed == casted.isReversed() && Objects.equ...
619
114
733
<methods>public Comparator<ENTITY> thenComparing(Comparator<? super ENTITY>) ,public Comparator<ENTITY> thenComparing(Function<? super ENTITY,? extends U>, Comparator<? super U>) ,public Comparator<ENTITY> thenComparing(Function<? super ENTITY,? extends U>) ,public Comparator<ENTITY> thenComparingDouble(ToDoubleFunctio...
speedment_speedment
speedment/runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/comparator/DoubleFieldComparatorImpl.java
DoubleFieldComparatorImpl
equals
class DoubleFieldComparatorImpl<ENTITY, D> extends AbstractFieldComparator<ENTITY> implements DoubleFieldComparator<ENTITY, D> { private final HasDoubleValue<ENTITY, D> field; private final boolean reversed; public DoubleFieldComparatorImpl(HasDoubleValue<ENTITY, D> field) { this(field, ...
if (this == obj) return true; if (!(obj instanceof FieldComparator)) return false; @SuppressWarnings("unchecked") final FieldComparator<ENTITY> casted = (FieldComparator<ENTITY>) obj; return reversed == casted.isReversed() && Objects.equ...
619
114
733
<methods>public Comparator<ENTITY> thenComparing(Comparator<? super ENTITY>) ,public Comparator<ENTITY> thenComparing(Function<? super ENTITY,? extends U>, Comparator<? super U>) ,public Comparator<ENTITY> thenComparing(Function<? super ENTITY,? extends U>) ,public Comparator<ENTITY> thenComparingDouble(ToDoubleFunctio...
speedment_speedment
speedment/runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/comparator/FloatFieldComparatorImpl.java
FloatFieldComparatorImpl
compare
class FloatFieldComparatorImpl<ENTITY, D> extends AbstractFieldComparator<ENTITY> implements FloatFieldComparator<ENTITY, D> { private final HasFloatValue<ENTITY, D> field; private final boolean reversed; public FloatFieldComparatorImpl(HasFloatValue<ENTITY, D> field) { this(field, false...
requireNonNulls(first, second); final float a = field.getAsFloat(first); final float b = field.getAsFloat(second); return applyReversed(Float.compare(a, b));
681
58
739
<methods>public Comparator<ENTITY> thenComparing(Comparator<? super ENTITY>) ,public Comparator<ENTITY> thenComparing(Function<? super ENTITY,? extends U>, Comparator<? super U>) ,public Comparator<ENTITY> thenComparing(Function<? super ENTITY,? extends U>) ,public Comparator<ENTITY> thenComparingDouble(ToDoubleFunctio...
speedment_speedment
speedment/runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/comparator/ReferenceFieldComparatorImpl.java
ReferenceFieldComparatorImpl
equals
class ReferenceFieldComparatorImpl <ENTITY, D, V extends Comparable<? super V>> extends AbstractFieldComparator<ENTITY> implements ReferenceFieldComparator<ENTITY, D, V> { private final ComparableField<ENTITY, D, V> field; private final NullOrder nullOrder; private final boolean reversed; publ...
if (this == obj) return true; if (!(obj instanceof FieldComparator)) return false; @SuppressWarnings("unchecked") final FieldComparator<ENTITY> casted = (FieldComparator<ENTITY>) obj; return reversed == casted.isReversed() && nullOrder ...
897
128
1,025
<methods>public Comparator<ENTITY> thenComparing(Comparator<? super ENTITY>) ,public Comparator<ENTITY> thenComparing(Function<? super ENTITY,? extends U>, Comparator<? super U>) ,public Comparator<ENTITY> thenComparing(Function<? super ENTITY,? extends U>) ,public Comparator<ENTITY> thenComparingDouble(ToDoubleFunctio...
speedment_speedment
speedment/runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/comparator/ShortFieldComparatorImpl.java
ShortFieldComparatorImpl
equals
class ShortFieldComparatorImpl<ENTITY, D> extends AbstractFieldComparator<ENTITY> implements ShortFieldComparator<ENTITY, D> { private final HasShortValue<ENTITY, D> field; private final boolean reversed; public ShortFieldComparatorImpl(HasShortValue<ENTITY, D> field) { this(field, false...
if (this == obj) return true; if (!(obj instanceof FieldComparator)) return false; @SuppressWarnings("unchecked") final FieldComparator<ENTITY> casted = (FieldComparator<ENTITY>) obj; return reversed == casted.isReversed() && Objects.equ...
619
114
733
<methods>public Comparator<ENTITY> thenComparing(Comparator<? super ENTITY>) ,public Comparator<ENTITY> thenComparing(Function<? super ENTITY,? extends U>, Comparator<? super U>) ,public Comparator<ENTITY> thenComparing(Function<? super ENTITY,? extends U>) ,public Comparator<ENTITY> thenComparingDouble(ToDoubleFunctio...
speedment_speedment
speedment/runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/expression/FieldToBigDecimalImpl.java
FieldToBigDecimalImpl
apply
class FieldToBigDecimalImpl<ENTITY, V> extends AbstractFieldMapper<ENTITY, V, BigDecimal, ToBigDecimal<ENTITY>, Function<V, BigDecimal>> implements FieldToBigDecimal<ENTITY, V> { public FieldToBigDecimalImpl(ReferenceField<ENTITY, ?, V> field, Function<V, BigDecimal> mapper) { ...
final V value = field.get(entity); if (value == null) return null; else return mapper.apply(value);
143
37
180
<methods>public ReferenceField<ENTITY,?,V> getField() ,public Function<V,java.math.BigDecimal> getMapper() ,public FieldIsNotNullPredicate<ENTITY,java.math.BigDecimal> isNotNull() ,public FieldIsNullPredicate<ENTITY,java.math.BigDecimal> isNull() <variables>final non-sealed ReferenceField<ENTITY,?,V> field,final non-se...
speedment_speedment
speedment/runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/expression/FieldToBooleanImpl.java
FieldToBooleanImpl
apply
class FieldToBooleanImpl<ENTITY, V> extends AbstractFieldMapper<ENTITY, V, Boolean, ToBoolean<ENTITY>, ToBooleanFunction<V>> implements FieldToBoolean<ENTITY, V> { public FieldToBooleanImpl( final ReferenceField<ENTITY, ?, V> field, final ToBooleanFunction<V> mapper ) { super(fi...
final V value = field.get(entity); if (value == null) return null; else return mapper.applyAsBoolean(value);
170
39
209
<methods>public ReferenceField<ENTITY,?,V> getField() ,public ToBooleanFunction<V> getMapper() ,public FieldIsNotNullPredicate<ENTITY,java.lang.Boolean> isNotNull() ,public FieldIsNullPredicate<ENTITY,java.lang.Boolean> isNull() <variables>final non-sealed ReferenceField<ENTITY,?,V> field,final non-sealed ToBooleanFunc...
speedment_speedment
speedment/runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/expression/FieldToByteImpl.java
FieldToByteImpl
apply
class FieldToByteImpl<ENTITY, V> extends AbstractFieldMapper<ENTITY, V, Byte, ToByte<ENTITY>, ToByteFunction<V>> implements FieldToByte<ENTITY, V> { public FieldToByteImpl(ReferenceField<ENTITY, ?, V> field, ToByteFunction<V> mapper) { super(field, mapper); } @Override ...
final V value = field.get(entity); if (value == null) return null; else return mapper.applyAsByte(value);
164
39
203
<methods>public ReferenceField<ENTITY,?,V> getField() ,public ToByteFunction<V> getMapper() ,public FieldIsNotNullPredicate<ENTITY,java.lang.Byte> isNotNull() ,public FieldIsNullPredicate<ENTITY,java.lang.Byte> isNull() <variables>final non-sealed ReferenceField<ENTITY,?,V> field,final non-sealed ToByteFunction<V> mapp...
speedment_speedment
speedment/runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/expression/FieldToCharImpl.java
FieldToCharImpl
apply
class FieldToCharImpl<ENTITY, V> extends AbstractFieldMapper<ENTITY, V, Character, ToChar<ENTITY>, ToCharFunction<V>> implements FieldToChar<ENTITY, V> { public FieldToCharImpl(ReferenceField<ENTITY, ?, V> field, ToCharFunction<V> mapper) { super(field, mapper); } @Overr...
final V value = field.get(entity); if (value == null) return null; else return mapper.applyAsChar(value);
164
39
203
<methods>public ReferenceField<ENTITY,?,V> getField() ,public ToCharFunction<V> getMapper() ,public FieldIsNotNullPredicate<ENTITY,java.lang.Character> isNotNull() ,public FieldIsNullPredicate<ENTITY,java.lang.Character> isNull() <variables>final non-sealed ReferenceField<ENTITY,?,V> field,final non-sealed ToCharFuncti...
speedment_speedment
speedment/runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/expression/FieldToDoubleImpl.java
FieldToDoubleImpl
apply
class FieldToDoubleImpl<ENTITY, V> extends AbstractFieldMapper<ENTITY, V, Double, ToDouble<ENTITY>, ToDoubleFunction<V>> implements FieldToDouble<ENTITY, V> { public FieldToDoubleImpl(ReferenceField<ENTITY, ?, V> field, ToDoubleFunction<V> mapper) { super(field, mapper); } ...
final V value = field.get(entity); if (value == null) return null; else return mapper.applyAsDouble(value);
164
39
203
<methods>public ReferenceField<ENTITY,?,V> getField() ,public ToDoubleFunction<V> getMapper() ,public FieldIsNotNullPredicate<ENTITY,java.lang.Double> isNotNull() ,public FieldIsNullPredicate<ENTITY,java.lang.Double> isNull() <variables>final non-sealed ReferenceField<ENTITY,?,V> field,final non-sealed ToDoubleFunction...
speedment_speedment
speedment/runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/expression/FieldToEnumImpl.java
FieldToEnumImpl
apply
class FieldToEnumImpl<ENTITY, V, E extends Enum<E>> extends AbstractFieldMapper<ENTITY, V, E, ToEnum<ENTITY, E>, Function<V, E>> implements FieldToEnum<ENTITY, V, E> { private final Class<E> enumClass; public FieldToEnumImpl(ReferenceField<ENTITY, ?, V> field, Function<V, E> mapper,...
final V value = field.get(entity); if (value == null) return null; else return mapper.apply(value);
198
37
235
<methods>public ReferenceField<ENTITY,?,V> getField() ,public Function<V,E> getMapper() ,public FieldIsNotNullPredicate<ENTITY,E> isNotNull() ,public FieldIsNullPredicate<ENTITY,E> isNull() <variables>final non-sealed ReferenceField<ENTITY,?,V> field,final non-sealed Function<V,E> mapper
speedment_speedment
speedment/runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/expression/FieldToFloatImpl.java
FieldToFloatImpl
apply
class FieldToFloatImpl<ENTITY, V> extends AbstractFieldMapper<ENTITY, V, Float, ToFloat<ENTITY>, ToFloatFunction<V>> implements FieldToFloat<ENTITY, V> { public FieldToFloatImpl(ReferenceField<ENTITY, ?, V> field, ToFloatFunction<V> mapper) { super(field, mapper); } @Ov...
final V value = field.get(entity); if (value == null) return null; else return mapper.applyAsFloat(value);
166
39
205
<methods>public ReferenceField<ENTITY,?,V> getField() ,public ToFloatFunction<V> getMapper() ,public FieldIsNotNullPredicate<ENTITY,java.lang.Float> isNotNull() ,public FieldIsNullPredicate<ENTITY,java.lang.Float> isNull() <variables>final non-sealed ReferenceField<ENTITY,?,V> field,final non-sealed ToFloatFunction<V> ...
speedment_speedment
speedment/runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/expression/FieldToLongImpl.java
FieldToLongImpl
apply
class FieldToLongImpl<ENTITY, V> extends AbstractFieldMapper<ENTITY, V, Long, ToLong<ENTITY>, ToLongFunction<V>> implements FieldToLong<ENTITY, V> { public FieldToLongImpl(ReferenceField<ENTITY, ?, V> field, ToLongFunction<V> mapper) { super(field, mapper); } @Override ...
final V value = field.get(entity); if (value == null) return null; else return mapper.applyAsLong(value);
164
39
203
<methods>public ReferenceField<ENTITY,?,V> getField() ,public ToLongFunction<V> getMapper() ,public FieldIsNotNullPredicate<ENTITY,java.lang.Long> isNotNull() ,public FieldIsNullPredicate<ENTITY,java.lang.Long> isNull() <variables>final non-sealed ReferenceField<ENTITY,?,V> field,final non-sealed ToLongFunction<V> mapp...
speedment_speedment
speedment/runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/method/FindFromByte.java
FindFromByte
apply
class FindFromByte<ENTITY, FK_ENTITY> extends AbstractFindFrom<ENTITY, FK_ENTITY, Byte, ByteForeignKeyField<ENTITY, ?, FK_ENTITY>, ByteField<FK_ENTITY, ?>> { public FindFromByte( ByteForeignKeyField<ENTITY, ?, FK_ENTITY> source, ByteField<FK_ENTITY, ?> target, TableIdentifie...
final byte value = getSourceField().getter().applyAsByte(entity); return stream() .filter(getTargetField().equal(value)) .findAny() .orElseThrow(() -> new SpeedmentFieldException( "Error! Could not find any entities in table '" + getT...
189
114
303
<methods>public final ByteForeignKeyField<ENTITY,?,FK_ENTITY> getSourceField() ,public final TableIdentifier<FK_ENTITY> getTableIdentifier() ,public final ByteField<FK_ENTITY,?> getTargetField() <variables>private final non-sealed TableIdentifier<FK_ENTITY> identifier,private final non-sealed ByteForeignKeyField<ENTITY...
speedment_speedment
speedment/runtime-parent/runtime-field/src/main/java/com/speedment/runtime/field/internal/method/FindFromChar.java
FindFromChar
apply
class FindFromChar<ENTITY, FK_ENTITY> extends AbstractFindFrom<ENTITY, FK_ENTITY, Character, CharForeignKeyField<ENTITY, ?, FK_ENTITY>, CharField<FK_ENTITY, ?>> { public FindFromChar( CharForeignKeyField<ENTITY, ?, FK_ENTITY> source, CharField<FK_ENTITY, ?> target, TableIden...
final char value = getSourceField().getter().applyAsChar(entity); return stream() .filter(getTargetField().equal(value)) .findAny() .orElseThrow(() -> new SpeedmentFieldException( "Error! Could not find any entities in table '" + getT...
189
114
303
<methods>public final CharForeignKeyField<ENTITY,?,FK_ENTITY> getSourceField() ,public final TableIdentifier<FK_ENTITY> getTableIdentifier() ,public final CharField<FK_ENTITY,?> getTargetField() <variables>private final non-sealed TableIdentifier<FK_ENTITY> identifier,private final non-sealed CharForeignKeyField<ENTITY...