diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/clause/IDeleteClause.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/clause/IDeleteClause.kt index 1f4c1bb6..0e7afce9 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/clause/IDeleteClause.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/clause/IDeleteClause.kt @@ -8,7 +8,7 @@ import ch.ergon.dope.resolvable.clause.model.DeleteWhereClause import ch.ergon.dope.resolvable.clause.model.ReturningClause import ch.ergon.dope.resolvable.expression.TypeExpression import ch.ergon.dope.resolvable.expression.unaliased.type.Field -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.validtype.ArrayType import ch.ergon.dope.validtype.BooleanType import ch.ergon.dope.validtype.NumberType @@ -23,12 +23,12 @@ interface IDeleteOffsetClause : IDeleteReturningClause { interface IDeleteLimitClause : IDeleteOffsetClause { fun offset(numberExpression: TypeExpression) = DeleteOffsetClause(numberExpression, this) - fun offset(number: Number): DeleteOffsetClause = offset(number.toNumberType()) + fun offset(number: Number): DeleteOffsetClause = offset(number.toDopeType()) } interface IDeleteWhereClause : IDeleteLimitClause { fun limit(numberExpression: TypeExpression) = DeleteLimitClause(numberExpression, this) - fun limit(number: Number): DeleteLimitClause = limit(number.toNumberType()) + fun limit(number: Number): DeleteLimitClause = limit(number.toDopeType()) } interface IDeleteUseKeysClause : IDeleteWhereClause { diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/clause/ISelectClause.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/clause/ISelectClause.kt index 0d902a10..79a3a0e8 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/clause/ISelectClause.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/clause/ISelectClause.kt @@ -19,7 +19,7 @@ import ch.ergon.dope.resolvable.clause.model.UnnestClause import ch.ergon.dope.resolvable.expression.AliasedExpression import ch.ergon.dope.resolvable.expression.TypeExpression import ch.ergon.dope.resolvable.expression.unaliased.type.Field -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.fromable.AliasedSelectClause import ch.ergon.dope.resolvable.fromable.Bucket import ch.ergon.dope.resolvable.fromable.Fromable @@ -33,12 +33,12 @@ interface ISelectOffsetClause : Clause interface ISelectLimitClause : ISelectOffsetClause { fun offset(numberExpression: TypeExpression): SelectOffsetClause = SelectOffsetClause(numberExpression, this) - fun offset(number: Number): SelectOffsetClause = offset(number.toNumberType()) + fun offset(number: Number): SelectOffsetClause = offset(number.toDopeType()) } interface ISelectOrderByClause : ISelectLimitClause { fun limit(numberExpression: TypeExpression): SelectLimitClause = SelectLimitClause(numberExpression, this) - fun limit(number: Number): SelectLimitClause = limit(number.toNumberType()) + fun limit(number: Number): SelectLimitClause = limit(number.toDopeType()) } interface ISelectGroupByClause : ISelectOrderByClause { diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/AliasedExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/AliasedExpression.kt index 1e0920a7..2daec0f0 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/AliasedExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/AliasedExpression.kt @@ -1,9 +1,7 @@ package ch.ergon.dope.resolvable.expression import ch.ergon.dope.DopeQuery -import ch.ergon.dope.resolvable.expression.unaliased.type.toBooleanType -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.formatToQueryStringWithSymbol import ch.ergon.dope.validtype.ValidType @@ -22,8 +20,8 @@ class AliasedExpression( fun UnaliasedExpression.alias(string: String): AliasedExpression = AliasedExpression(this, string) -fun Number.alias(string: String) = this.toNumberType().alias(string) +fun Number.alias(string: String) = this.toDopeType().alias(string) -fun String.alias(string: String) = this.toStringType().alias(string) +fun String.alias(string: String) = this.toDopeType().alias(string) -fun Boolean.alias(string: String) = this.toBooleanType().alias(string) +fun Boolean.alias(string: String) = this.toDopeType().alias(string) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/Primitive.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/Primitive.kt index e90908e1..c9f6b7f8 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/Primitive.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/Primitive.kt @@ -54,10 +54,10 @@ class ArrayPrimitive(collection: Collection }, ) -fun String.toStringType(): StringPrimitive = StringPrimitive(this) +fun String.toDopeType(): StringPrimitive = StringPrimitive(this) -fun Number.toNumberType(): NumberPrimitive = NumberPrimitive(this) +fun Number.toDopeType(): NumberPrimitive = NumberPrimitive(this) -fun Boolean.toBooleanType(): BooleanPrimitive = BooleanPrimitive(this) +fun Boolean.toDopeType(): BooleanPrimitive = BooleanPrimitive(this) -fun Collection>.toArrayType() = ArrayPrimitive(this) +fun Collection>.toDopeType() = ArrayPrimitive(this) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/arithmetic/NegationExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/arithmetic/NegationExpression.kt index 51638b43..6a625b90 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/arithmetic/NegationExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/arithmetic/NegationExpression.kt @@ -2,7 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.arithmetic import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.PrefixOperator import ch.ergon.dope.validtype.NumberType @@ -15,4 +15,4 @@ class NegationExpression( fun neg(numberExpression: TypeExpression): NegationExpression = NegationExpression(numberExpression) -fun neg(number: Number): NegationExpression = neg(number.toNumberType()) +fun neg(number: Number): NegationExpression = neg(number.toDopeType()) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/arithmetic/NumberInfixExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/arithmetic/NumberInfixExpression.kt index ca4d5f5a..5a40605b 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/arithmetic/NumberInfixExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/arithmetic/NumberInfixExpression.kt @@ -2,7 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.arithmetic import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.formatToQueryStringWithBrackets import ch.ergon.dope.resolvable.operator.InfixOperator import ch.ergon.dope.validtype.NumberType @@ -38,43 +38,43 @@ fun TypeExpression.mod(numberExpression: TypeExpression) NumberInfixExpression(this, "%", numberExpression) fun TypeExpression.add(number: Number): NumberInfixExpression = - add(number.toNumberType()) + add(number.toDopeType()) fun Number.add(numberExpression: TypeExpression): NumberInfixExpression = - this.toNumberType().add(numberExpression) + this.toDopeType().add(numberExpression) fun Number.add(number: Number): NumberInfixExpression = - this.toNumberType().add(number.toNumberType()) + this.toDopeType().add(number.toDopeType()) fun TypeExpression.sub(number: Number): NumberInfixExpression = - sub(number.toNumberType()) + sub(number.toDopeType()) fun Number.sub(numberExpression: TypeExpression): NumberInfixExpression = - this.toNumberType().sub(numberExpression) + this.toDopeType().sub(numberExpression) fun Number.sub(number: Number): NumberInfixExpression = - this.toNumberType().sub(number.toNumberType()) + this.toDopeType().sub(number.toDopeType()) fun TypeExpression.mul(number: Number): NumberInfixExpression = - mul(number.toNumberType()) + mul(number.toDopeType()) fun Number.mul(numberExpression: TypeExpression): NumberInfixExpression = - this.toNumberType().mul(numberExpression) + this.toDopeType().mul(numberExpression) fun Number.mul(number: Number): NumberInfixExpression = - this.toNumberType().mul(number.toNumberType()) + this.toDopeType().mul(number.toDopeType()) fun TypeExpression.div(number: Number): NumberInfixExpression = - div(number.toNumberType()) + div(number.toDopeType()) fun Number.div(numberExpression: TypeExpression): NumberInfixExpression = - this.toNumberType().div(numberExpression) + this.toDopeType().div(numberExpression) fun TypeExpression.mod(number: Number): NumberInfixExpression = - mod(number.toNumberType()) + mod(number.toDopeType()) fun Number.mod(numberExpression: TypeExpression): NumberInfixExpression = - this.toNumberType().mod(numberExpression) + this.toDopeType().mod(numberExpression) fun Number.mod(number: Number): NumberInfixExpression = - this.toNumberType().mod(number.toNumberType()) + this.toDopeType().mod(number.toDopeType()) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/logical/LogicalInfixExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/logical/LogicalInfixExpression.kt index 971d1d0c..09044761 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/logical/LogicalInfixExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/logical/LogicalInfixExpression.kt @@ -2,7 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.logical import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toBooleanType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.InfixOperator import ch.ergon.dope.validtype.BooleanType @@ -21,13 +21,13 @@ fun TypeExpression.and(booleanExpression: TypeExpression.or(boolean: Boolean): LogicalInfixExpression = - this.or(boolean.toBooleanType()) + this.or(boolean.toDopeType()) fun Boolean.or(booleanExpression: TypeExpression): LogicalInfixExpression = - this.toBooleanType().or(booleanExpression) + this.toDopeType().or(booleanExpression) fun TypeExpression.and(boolean: Boolean): LogicalInfixExpression = - this.and(boolean.toBooleanType()) + this.and(boolean.toDopeType()) fun Boolean.and(booleanExpression: TypeExpression): LogicalInfixExpression = - this.toBooleanType().and(booleanExpression) + this.toDopeType().and(booleanExpression) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/logical/NotExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/logical/NotExpression.kt index a005af7a..cad51fcc 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/logical/NotExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/logical/NotExpression.kt @@ -2,7 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.logical import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toBooleanType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.PrefixOperator import ch.ergon.dope.validtype.BooleanType @@ -14,4 +14,4 @@ class NotExpression( fun not(expression: TypeExpression) = NotExpression(expression) -fun not(boolean: Boolean) = not(boolean.toBooleanType()) +fun not(boolean: Boolean) = not(boolean.toDopeType()) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/EqualsExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/EqualsExpression.kt index 8327b6a0..57d21bae 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/EqualsExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/EqualsExpression.kt @@ -2,9 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.relational import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toBooleanType -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.InfixOperator import ch.ergon.dope.validtype.BooleanType import ch.ergon.dope.validtype.NumberType @@ -22,28 +20,28 @@ fun TypeExpression.isEqualTo(right: TypeExpression): Equal EqualsExpression(this, right) fun TypeExpression.isEqualTo(right: Number): EqualsExpression = - isEqualTo(right.toNumberType()) + isEqualTo(right.toDopeType()) fun Number.isEqualTo(right: TypeExpression): EqualsExpression = - toNumberType().isEqualTo(right) + toDopeType().isEqualTo(right) fun Number.isEqualTo(right: Number): EqualsExpression = - toNumberType().isEqualTo(right.toNumberType()) + toDopeType().isEqualTo(right.toDopeType()) fun TypeExpression.isEqualTo(right: String): EqualsExpression = - isEqualTo(right.toStringType()) + isEqualTo(right.toDopeType()) fun String.isEqualTo(right: TypeExpression): EqualsExpression = - toStringType().isEqualTo(right) + toDopeType().isEqualTo(right) fun String.isEqualTo(right: String): EqualsExpression = - toStringType().isEqualTo(right.toStringType()) + toDopeType().isEqualTo(right.toDopeType()) fun TypeExpression.isEqualTo(right: Boolean): EqualsExpression = - isEqualTo(right.toBooleanType()) + isEqualTo(right.toDopeType()) fun Boolean.isEqualTo(right: TypeExpression): EqualsExpression = - toBooleanType().isEqualTo(right) + toDopeType().isEqualTo(right) fun Boolean.isEqualTo(right: Boolean): EqualsExpression = - toBooleanType().isEqualTo(right.toBooleanType()) + toDopeType().isEqualTo(right.toDopeType()) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/GreaterOrEqualThanExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/GreaterOrEqualThanExpression.kt index 288f2ced..588c614f 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/GreaterOrEqualThanExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/GreaterOrEqualThanExpression.kt @@ -2,8 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.relational import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.InfixOperator import ch.ergon.dope.validtype.BooleanType import ch.ergon.dope.validtype.ComparableType @@ -21,19 +20,19 @@ fun TypeExpression.isGreaterOrEqualThan(right: TypeExpre GreaterOrEqualThanExpression(this, right) fun TypeExpression.isGreaterOrEqualThan(right: Number): GreaterOrEqualThanExpression = - isGreaterOrEqualThan(right.toNumberType()) + isGreaterOrEqualThan(right.toDopeType()) fun Number.isGreaterOrEqualThan(right: TypeExpression): GreaterOrEqualThanExpression = - toNumberType().isGreaterOrEqualThan(right) + toDopeType().isGreaterOrEqualThan(right) fun Number.isGreaterOrEqualThan(right: Number): GreaterOrEqualThanExpression = - toNumberType().isGreaterOrEqualThan(right.toNumberType()) + toDopeType().isGreaterOrEqualThan(right.toDopeType()) fun TypeExpression.isGreaterOrEqualThan(right: String): GreaterOrEqualThanExpression = - isGreaterOrEqualThan(right.toStringType()) + isGreaterOrEqualThan(right.toDopeType()) fun String.isGreaterOrEqualThan(right: TypeExpression): GreaterOrEqualThanExpression = - toStringType().isGreaterOrEqualThan(right) + toDopeType().isGreaterOrEqualThan(right) fun String.isGreaterOrEqualThan(right: String): GreaterOrEqualThanExpression = - toStringType().isGreaterOrEqualThan(right.toStringType()) + toDopeType().isGreaterOrEqualThan(right.toDopeType()) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/GreaterThanExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/GreaterThanExpression.kt index d48ae072..aa08699c 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/GreaterThanExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/GreaterThanExpression.kt @@ -2,8 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.relational import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.InfixOperator import ch.ergon.dope.validtype.BooleanType import ch.ergon.dope.validtype.ComparableType @@ -21,19 +20,19 @@ fun TypeExpression.isGreaterThan(right: TypeExpression.isGreaterThan(right: Number): GreaterThanExpression = - isGreaterThan(right.toNumberType()) + isGreaterThan(right.toDopeType()) fun Number.isGreaterThan(right: TypeExpression): GreaterThanExpression = - this.toNumberType().isGreaterThan(right) + this.toDopeType().isGreaterThan(right) fun Number.isGreaterThan(right: Number): GreaterThanExpression = - this.toNumberType().isGreaterThan(right.toNumberType()) + this.toDopeType().isGreaterThan(right.toDopeType()) fun TypeExpression.isGreaterThan(right: String): GreaterThanExpression = - isGreaterThan(right.toStringType()) + isGreaterThan(right.toDopeType()) fun String.isGreaterThan(right: TypeExpression): GreaterThanExpression = - this.toStringType().isGreaterThan(right) + this.toDopeType().isGreaterThan(right) fun String.isGreaterThan(right: String): GreaterThanExpression = - this.toStringType().isGreaterThan(right.toStringType()) + this.toDopeType().isGreaterThan(right.toDopeType()) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/InExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/InExpression.kt index d96ecfe8..4a740403 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/InExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/InExpression.kt @@ -2,10 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.relational import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toArrayType -import ch.ergon.dope.resolvable.expression.unaliased.type.toBooleanType -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.InfixOperator import ch.ergon.dope.validtype.ArrayType import ch.ergon.dope.validtype.BooleanType @@ -24,22 +21,22 @@ fun TypeExpression.inArray(array: TypeExpression InExpression(this, array) fun Number.inArray(array: TypeExpression>): InExpression = - toNumberType().inArray(array) + toDopeType().inArray(array) fun String.inArray(array: TypeExpression>): InExpression = - toStringType().inArray(array) + toDopeType().inArray(array) fun Boolean.inArray(array: TypeExpression>): InExpression = - toBooleanType().inArray(array) + toDopeType().inArray(array) fun TypeExpression.inArray(array: Collection>): InExpression = - this.inArray(array.toArrayType()) + this.inArray(array.toDopeType()) fun Number.inArray(array: Collection>): InExpression = - inArray(array.toArrayType()) + inArray(array.toDopeType()) fun String.inArray(array: Collection>): InExpression = - inArray(array.toArrayType()) + inArray(array.toDopeType()) fun Boolean.inArray(array: Collection>): InExpression = - inArray(array.toArrayType()) + inArray(array.toDopeType()) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/LessOrEqualThanExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/LessOrEqualThanExpression.kt index fb8e824f..dd45c449 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/LessOrEqualThanExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/LessOrEqualThanExpression.kt @@ -2,8 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.relational import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.InfixOperator import ch.ergon.dope.validtype.BooleanType import ch.ergon.dope.validtype.ComparableType @@ -21,13 +20,13 @@ fun TypeExpression.isLessOrEqualThan(right: TypeExpressi LessOrEqualThanExpression(this, right) fun TypeExpression.isLessOrEqualThan(right: Number): LessOrEqualThanExpression = - isLessOrEqualThan(right.toNumberType()) + isLessOrEqualThan(right.toDopeType()) fun Number.isLessOrEqualThan(right: TypeExpression): LessOrEqualThanExpression = - toNumberType().isLessOrEqualThan(right) + toDopeType().isLessOrEqualThan(right) fun TypeExpression.isLessOrEqualThan(right: String): LessOrEqualThanExpression = - isLessOrEqualThan(right.toStringType()) + isLessOrEqualThan(right.toDopeType()) fun String.isLessOrEqualThan(right: TypeExpression): LessOrEqualThanExpression = - toStringType().isLessOrEqualThan(right) + toDopeType().isLessOrEqualThan(right) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/LessThanExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/LessThanExpression.kt index ec533715..398d410f 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/LessThanExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/LessThanExpression.kt @@ -2,8 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.relational import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.InfixOperator import ch.ergon.dope.validtype.BooleanType import ch.ergon.dope.validtype.ComparableType @@ -21,19 +20,19 @@ fun TypeExpression.isLessThan(right: TypeExpression): LessThanExpression(this, right) fun TypeExpression.isLessThan(right: Number): LessThanExpression = - isLessThan(right.toNumberType()) + isLessThan(right.toDopeType()) fun Number.isLessThan(right: TypeExpression): LessThanExpression = - this.toNumberType().isLessThan(right) + this.toDopeType().isLessThan(right) fun Number.isLessThan(right: Number): LessThanExpression = - this.toNumberType().isLessThan(right.toNumberType()) + this.toDopeType().isLessThan(right.toDopeType()) fun TypeExpression.isLessThan(right: String): LessThanExpression = - isLessThan(right.toStringType()) + isLessThan(right.toDopeType()) fun String.isLessThan(right: TypeExpression): LessThanExpression = - this.toStringType().isLessThan(right) + this.toDopeType().isLessThan(right) fun String.isLessThan(right: String): LessThanExpression = - this.toStringType().isLessThan(right.toStringType()) + this.toDopeType().isLessThan(right.toDopeType()) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/LikeExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/LikeExpression.kt index 4c9610f6..fc07e4a8 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/LikeExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/LikeExpression.kt @@ -3,7 +3,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.relational import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression import ch.ergon.dope.resolvable.expression.unaliased.type.Field -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.InfixOperator import ch.ergon.dope.validtype.BooleanType import ch.ergon.dope.validtype.StringType @@ -18,4 +18,4 @@ class LikeExpression( fun Field.isLike(right: TypeExpression): LikeExpression = LikeExpression(this, right) -fun Field.isLike(right: String): LikeExpression = isLike(right.toStringType()) +fun Field.isLike(right: String): LikeExpression = isLike(right.toDopeType()) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/NotEqualsExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/NotEqualsExpression.kt index 7c10b436..3c5f0ac0 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/NotEqualsExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/NotEqualsExpression.kt @@ -2,9 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.relational import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toBooleanType -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.InfixOperator import ch.ergon.dope.validtype.BooleanType import ch.ergon.dope.validtype.NumberType @@ -22,28 +20,28 @@ fun TypeExpression.isNotEqualTo(right: TypeExpression): No NotEqualsExpression(this, right) fun TypeExpression.isNotEqualTo(right: Number): NotEqualsExpression = - isNotEqualTo(right.toNumberType()) + isNotEqualTo(right.toDopeType()) fun Number.isNotEqualTo(right: TypeExpression): NotEqualsExpression = - toNumberType().isNotEqualTo(right) + toDopeType().isNotEqualTo(right) fun Number.isNotEqualTo(right: Number): NotEqualsExpression = - toNumberType().isNotEqualTo(right.toNumberType()) + toDopeType().isNotEqualTo(right.toDopeType()) fun TypeExpression.isNotEqualTo(right: String): NotEqualsExpression = - isNotEqualTo(right.toStringType()) + isNotEqualTo(right.toDopeType()) fun String.isNotEqualTo(right: TypeExpression): NotEqualsExpression = - toStringType().isNotEqualTo(right) + toDopeType().isNotEqualTo(right) fun String.isNotEqualTo(right: String): NotEqualsExpression = - toStringType().isNotEqualTo(right.toStringType()) + toDopeType().isNotEqualTo(right.toDopeType()) fun TypeExpression.isNotEqualTo(right: Boolean): NotEqualsExpression = - isNotEqualTo(right.toBooleanType()) + isNotEqualTo(right.toDopeType()) fun Boolean.isNotEqualTo(right: TypeExpression): NotEqualsExpression = - toBooleanType().isNotEqualTo(right) + toDopeType().isNotEqualTo(right) fun Boolean.isNotEqualTo(right: Boolean): NotEqualsExpression = - toBooleanType().isNotEqualTo(right.toBooleanType()) + toDopeType().isNotEqualTo(right.toDopeType()) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/NotLikeExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/NotLikeExpression.kt index ddfc22a4..eb1e0603 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/NotLikeExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/NotLikeExpression.kt @@ -3,7 +3,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.relational import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression import ch.ergon.dope.resolvable.expression.unaliased.type.Field -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.InfixOperator import ch.ergon.dope.validtype.BooleanType import ch.ergon.dope.validtype.StringType @@ -18,4 +18,4 @@ class NotLikeExpression( fun Field.isNotLike(right: TypeExpression): NotLikeExpression = NotLikeExpression(this, right) -fun Field.isNotLike(right: String): NotLikeExpression = this.isNotLike(right.toStringType()) +fun Field.isNotLike(right: String): NotLikeExpression = this.isNotLike(right.toDopeType()) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/SatisfiesExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/SatisfiesExpression.kt index d26b9e91..5c6235d0 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/SatisfiesExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/relational/SatisfiesExpression.kt @@ -4,7 +4,7 @@ import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression import ch.ergon.dope.resolvable.expression.unaliased.type.relational.SatisfiesType.ANY import ch.ergon.dope.resolvable.expression.unaliased.type.relational.SatisfiesType.EVERY -import ch.ergon.dope.resolvable.expression.unaliased.type.toArrayType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.validtype.ArrayType import ch.ergon.dope.validtype.BooleanType import ch.ergon.dope.validtype.ValidType @@ -70,7 +70,7 @@ fun TypeExpression>.any( fun Collection>.any( variable: String = DEFAULT_ITERATOR_VARIABLE, predicate: (Iterator) -> TypeExpression, -): AnySatisfiesExpression = AnySatisfiesExpression(toArrayType(), variable, predicate) +): AnySatisfiesExpression = AnySatisfiesExpression(toDopeType(), variable, predicate) fun TypeExpression>.every( variable: String = DEFAULT_ITERATOR_VARIABLE, @@ -80,4 +80,4 @@ fun TypeExpression>.every( fun Collection>.every( variable: String = DEFAULT_ITERATOR_VARIABLE, predicate: (Iterator) -> TypeExpression, -): EverySatisfiesExpression = EverySatisfiesExpression(toArrayType(), variable, predicate) +): EverySatisfiesExpression = EverySatisfiesExpression(toDopeType(), variable, predicate) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/Concat2Expression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/Concat2Expression.kt index fb1fe623..f7e5428e 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/Concat2Expression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/Concat2Expression.kt @@ -2,7 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.FunctionOperator import ch.ergon.dope.validtype.StringType @@ -34,8 +34,8 @@ fun concat2(separator: TypeExpression, string: TypeExpression, string: String, vararg strings: String): Concat2Expression = concat2( separator, - string.toStringType(), + string.toDopeType(), *wrapVarargsWithStringValueType( *strings, ), ) fun concat2(separator: String, string: TypeExpression, vararg strings: TypeExpression): Concat2Expression = - concat2(separator.toStringType(), string, *strings) + concat2(separator.toDopeType(), string, *strings) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/ConcatExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/ConcatExpression.kt index f74e17c8..6b92eea3 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/ConcatExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/ConcatExpression.kt @@ -2,7 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.FunctionOperator import ch.ergon.dope.validtype.StringType @@ -33,6 +33,6 @@ fun concat(firstString: TypeExpression, secondString: TypeExpression ConcatExpression(firstString, secondString, *strings) fun concat(firstString: String, secondString: String, vararg strings: String): ConcatExpression = - concat(firstString.toStringType(), secondString.toStringType(), *wrapVarargsWithStringValueType(*strings)) + concat(firstString.toDopeType(), secondString.toDopeType(), *wrapVarargsWithStringValueType(*strings)) -internal fun wrapVarargsWithStringValueType(vararg strings: String) = strings.map { it.toStringType() }.toTypedArray() +internal fun wrapVarargsWithStringValueType(vararg strings: String) = strings.map { it.toDopeType() }.toTypedArray() diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/ContainsExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/ContainsExpression.kt index ba72e015..0a78744d 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/ContainsExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/ContainsExpression.kt @@ -2,7 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.FunctionOperator import ch.ergon.dope.validtype.BooleanType import ch.ergon.dope.validtype.StringType @@ -23,8 +23,8 @@ class ContainsExpression( fun contains(inStr: TypeExpression, searchStr: TypeExpression): ContainsExpression = ContainsExpression(inStr, searchStr) -fun contains(inStr: String, searchStr: String): ContainsExpression = contains(inStr.toStringType(), searchStr.toStringType()) +fun contains(inStr: String, searchStr: String): ContainsExpression = contains(inStr.toDopeType(), searchStr.toDopeType()) -fun contains(inStr: TypeExpression, searchStr: String): ContainsExpression = contains(inStr, searchStr.toStringType()) +fun contains(inStr: TypeExpression, searchStr: String): ContainsExpression = contains(inStr, searchStr.toDopeType()) -fun contains(inStr: String, searchStr: TypeExpression): ContainsExpression = contains(inStr.toStringType(), searchStr) +fun contains(inStr: String, searchStr: TypeExpression): ContainsExpression = contains(inStr.toDopeType(), searchStr) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/InitCapExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/InitCapExpression.kt index a8783bc5..5f1a1790 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/InitCapExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/InitCapExpression.kt @@ -2,7 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.FunctionOperator import ch.ergon.dope.validtype.StringType @@ -20,7 +20,7 @@ class InitCapExpression( fun initCap(inStr: TypeExpression) = InitCapExpression(inStr) -fun initCap(inStr: String): InitCapExpression = initCap(inStr.toStringType()) +fun initCap(inStr: String): InitCapExpression = initCap(inStr.toDopeType()) fun title(inStr: String) = initCap(inStr) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/LengthExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/LengthExpression.kt index d4c2a528..60560b1a 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/LengthExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/LengthExpression.kt @@ -2,7 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.FunctionOperator import ch.ergon.dope.validtype.StringType @@ -20,4 +20,4 @@ class LengthExpression( fun length(inStr: TypeExpression): LengthExpression = LengthExpression(inStr) -fun length(inStr: String): LengthExpression = length(inStr.toStringType()) +fun length(inStr: String): LengthExpression = length(inStr.toDopeType()) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/LowerExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/LowerExpression.kt index 8c59cf35..8b07261f 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/LowerExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/LowerExpression.kt @@ -2,7 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.FunctionOperator import ch.ergon.dope.validtype.StringType @@ -20,4 +20,4 @@ class LowerExpression( fun lower(inStr: TypeExpression): LowerExpression = LowerExpression(inStr) -fun lower(inStr: String): LowerExpression = lower(inStr.toStringType()) +fun lower(inStr: String): LowerExpression = lower(inStr.toDopeType()) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/LpadExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/LpadExpression.kt index 5ff389b8..679aa319 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/LpadExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/LpadExpression.kt @@ -2,8 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.FunctionOperator import ch.ergon.dope.validtype.NumberType import ch.ergon.dope.validtype.StringType @@ -32,26 +31,26 @@ fun lpad( LpadExpression(inStr, size, prefix) fun lpad(inStr: TypeExpression, size: TypeExpression, prefix: String): LpadExpression = - lpad(inStr, size, prefix.toStringType()) + lpad(inStr, size, prefix.toDopeType()) fun lpad(inStr: TypeExpression, size: Number, prefix: TypeExpression): LpadExpression = - lpad(inStr, size.toNumberType(), prefix) + lpad(inStr, size.toDopeType(), prefix) fun lpad(inStr: String, size: TypeExpression, prefix: TypeExpression): LpadExpression = - lpad(inStr.toStringType(), size, prefix) + lpad(inStr.toDopeType(), size, prefix) -fun lpad(inStr: TypeExpression, size: Number): LpadExpression = lpad(inStr, size.toNumberType()) +fun lpad(inStr: TypeExpression, size: Number): LpadExpression = lpad(inStr, size.toDopeType()) fun lpad(inStr: TypeExpression, size: Number, prefix: String): LpadExpression = - lpad(inStr, size.toNumberType(), prefix.toStringType()) + lpad(inStr, size.toDopeType(), prefix.toDopeType()) -fun lpad(inStr: String, size: TypeExpression): LpadExpression = lpad(inStr.toStringType(), size) +fun lpad(inStr: String, size: TypeExpression): LpadExpression = lpad(inStr.toDopeType(), size) fun lpad(inStr: String, size: TypeExpression, prefix: String): LpadExpression = - lpad(inStr.toStringType(), size, prefix.toStringType()) + lpad(inStr.toDopeType(), size, prefix.toDopeType()) -fun lpad(inStr: String, size: Number, prefix: TypeExpression) = lpad(inStr.toStringType(), size.toNumberType(), prefix) +fun lpad(inStr: String, size: Number, prefix: TypeExpression) = lpad(inStr.toDopeType(), size.toDopeType(), prefix) -fun lpad(inStr: String, size: Number): LpadExpression = lpad(inStr.toStringType(), size.toNumberType()) +fun lpad(inStr: String, size: Number): LpadExpression = lpad(inStr.toDopeType(), size.toDopeType()) -fun lpad(inStr: String, size: Number, prefix: String): LpadExpression = lpad(inStr.toStringType(), size.toNumberType(), prefix.toStringType()) +fun lpad(inStr: String, size: Number, prefix: String): LpadExpression = lpad(inStr.toDopeType(), size.toDopeType(), prefix.toDopeType()) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/LtrimExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/LtrimExpression.kt index 753d3521..86855db1 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/LtrimExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/LtrimExpression.kt @@ -2,7 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.FunctionOperator import ch.ergon.dope.validtype.StringType @@ -23,10 +23,10 @@ class LtrimExpression( fun ltrim(inStr: TypeExpression, extra: TypeExpression? = null): LtrimExpression = LtrimExpression(inStr, extra) -fun ltrim(inStr: TypeExpression, extra: String): LtrimExpression = ltrim(inStr, extra.toStringType()) +fun ltrim(inStr: TypeExpression, extra: String): LtrimExpression = ltrim(inStr, extra.toDopeType()) -fun ltrim(inStr: String, extra: TypeExpression): LtrimExpression = ltrim(inStr.toStringType(), extra) +fun ltrim(inStr: String, extra: TypeExpression): LtrimExpression = ltrim(inStr.toDopeType(), extra) -fun ltrim(inStr: String, extra: String): LtrimExpression = ltrim(inStr.toStringType(), extra.toStringType()) +fun ltrim(inStr: String, extra: String): LtrimExpression = ltrim(inStr.toDopeType(), extra.toDopeType()) -fun ltrim(inStr: String): LtrimExpression = ltrim(inStr.toStringType()) +fun ltrim(inStr: String): LtrimExpression = ltrim(inStr.toDopeType()) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/MaskExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/MaskExpression.kt index 149d6e64..8449f787 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/MaskExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/MaskExpression.kt @@ -2,7 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.FunctionOperator import ch.ergon.dope.validtype.StringType @@ -26,4 +26,4 @@ class MaskExpression( fun mask(inStr: TypeExpression, options: Map = mapOf()): MaskExpression = MaskExpression(inStr, options) -fun mask(inStr: String, options: Map = mapOf()): MaskExpression = mask(inStr.toStringType(), options) +fun mask(inStr: String, options: Map = mapOf()): MaskExpression = mask(inStr.toDopeType(), options) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/NowStrExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/NowStrExpression.kt index 2962bf5a..c92bb072 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/NowStrExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/NowStrExpression.kt @@ -2,7 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.FunctionOperator import ch.ergon.dope.validtype.StringType @@ -21,4 +21,4 @@ class NowStrExpression( // todo: DOPE-177 fun nowStr(format: TypeExpression? = null): NowStrExpression = NowStrExpression(format) -fun nowStr(format: String): NowStrExpression = nowStr(format.toStringType()) +fun nowStr(format: String): NowStrExpression = nowStr(format.toDopeType()) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/PositionExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/PositionExpression.kt index 6de6f153..de4aaeca 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/PositionExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/PositionExpression.kt @@ -2,7 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.FunctionOperator import ch.ergon.dope.validtype.StringType @@ -23,8 +23,8 @@ class PositionExpression( fun position(inStr: TypeExpression, searchStr: TypeExpression): PositionExpression = PositionExpression(inStr, searchStr) -fun position(inStr: String, searchStr: String): PositionExpression = position(inStr.toStringType(), searchStr.toStringType()) +fun position(inStr: String, searchStr: String): PositionExpression = position(inStr.toDopeType(), searchStr.toDopeType()) -fun position(inStr: TypeExpression, searchStr: String): PositionExpression = position(inStr, searchStr.toStringType()) +fun position(inStr: TypeExpression, searchStr: String): PositionExpression = position(inStr, searchStr.toDopeType()) -fun position(inStr: String, searchStr: TypeExpression): PositionExpression = position(inStr.toStringType(), searchStr) +fun position(inStr: String, searchStr: TypeExpression): PositionExpression = position(inStr.toDopeType(), searchStr) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/RepeatExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/RepeatExpression.kt index fd04b7cb..72fd5c76 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/RepeatExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/RepeatExpression.kt @@ -2,8 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.FunctionOperator import ch.ergon.dope.validtype.NumberType import ch.ergon.dope.validtype.StringType @@ -24,8 +23,8 @@ class RepeatExpression( fun repeat(inStr: TypeExpression, repeatAmount: TypeExpression) = RepeatExpression(inStr, repeatAmount) -fun repeat(inStr: TypeExpression, repeatAmount: Number) = repeat(inStr, repeatAmount.toNumberType()) +fun repeat(inStr: TypeExpression, repeatAmount: Number) = repeat(inStr, repeatAmount.toDopeType()) -fun repeat(inStr: String, repeatAmount: TypeExpression) = repeat(inStr.toStringType(), repeatAmount) +fun repeat(inStr: String, repeatAmount: TypeExpression) = repeat(inStr.toDopeType(), repeatAmount) -fun repeat(inStr: String, repeatAmount: Number): RepeatExpression = repeat(inStr.toStringType(), repeatAmount.toNumberType()) +fun repeat(inStr: String, repeatAmount: Number): RepeatExpression = repeat(inStr.toDopeType(), repeatAmount.toDopeType()) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/ReverseExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/ReverseExpression.kt index 97809912..8f8e96ca 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/ReverseExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/ReverseExpression.kt @@ -2,7 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.FunctionOperator import ch.ergon.dope.validtype.StringType @@ -20,4 +20,4 @@ class ReverseExpression( fun reverse(inStr: TypeExpression) = ReverseExpression(inStr) -fun reverse(inStr: String): ReverseExpression = reverse(inStr.toStringType()) +fun reverse(inStr: String): ReverseExpression = reverse(inStr.toDopeType()) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/RpadExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/RpadExpression.kt index a2f7eadd..157b7538 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/RpadExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/RpadExpression.kt @@ -2,8 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.FunctionOperator import ch.ergon.dope.validtype.NumberType import ch.ergon.dope.validtype.StringType @@ -32,22 +31,22 @@ fun rpad( RpadExpression(inStr, size, extra) fun rpad(inStr: TypeExpression, size: TypeExpression, extra: String): RpadExpression = - rpad(inStr, size, extra.toStringType()) + rpad(inStr, size, extra.toDopeType()) fun rpad(inStr: TypeExpression, size: Number, extra: TypeExpression): RpadExpression = - rpad(inStr, size.toNumberType(), extra) + rpad(inStr, size.toDopeType(), extra) -fun rpad(inStr: TypeExpression, size: Number, extra: String): RpadExpression = rpad(inStr, size.toNumberType(), extra) +fun rpad(inStr: TypeExpression, size: Number, extra: String): RpadExpression = rpad(inStr, size.toDopeType(), extra) -fun rpad(inStr: TypeExpression, size: Number): RpadExpression = rpad(inStr, size.toNumberType()) +fun rpad(inStr: TypeExpression, size: Number): RpadExpression = rpad(inStr, size.toDopeType()) fun rpad(inStr: String, size: TypeExpression, extra: TypeExpression): RpadExpression = - rpad(inStr.toStringType(), size, extra) + rpad(inStr.toDopeType(), size, extra) -fun rpad(inStr: String, size: TypeExpression): RpadExpression = rpad(inStr.toStringType(), size) +fun rpad(inStr: String, size: TypeExpression): RpadExpression = rpad(inStr.toDopeType(), size) -fun rpad(inStr: String, size: Number, extra: TypeExpression): RpadExpression = rpad(inStr.toStringType(), size.toNumberType(), extra) +fun rpad(inStr: String, size: Number, extra: TypeExpression): RpadExpression = rpad(inStr.toDopeType(), size.toDopeType(), extra) -fun rpad(inStr: String, size: Number, extra: String): RpadExpression = rpad(inStr.toStringType(), size.toNumberType(), extra.toStringType()) +fun rpad(inStr: String, size: Number, extra: String): RpadExpression = rpad(inStr.toDopeType(), size.toDopeType(), extra.toDopeType()) -fun rpad(inStr: String, size: Number): RpadExpression = rpad(inStr.toStringType(), size.toNumberType()) +fun rpad(inStr: String, size: Number): RpadExpression = rpad(inStr.toDopeType(), size.toDopeType()) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/RtrimExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/RtrimExpression.kt index 4c6bb4ff..6a1a3816 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/RtrimExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/RtrimExpression.kt @@ -2,7 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.FunctionOperator import ch.ergon.dope.validtype.StringType @@ -22,12 +22,12 @@ class RtrimExpression( fun rtrim(inStr: TypeExpression, extra: TypeExpression? = null) = RtrimExpression(inStr, extra) -fun rtrim(inStr: TypeExpression, extra: String) = rtrim(inStr, extra.toStringType()) +fun rtrim(inStr: TypeExpression, extra: String) = rtrim(inStr, extra.toDopeType()) -fun rtrim(inStr: String, extra: TypeExpression? = null) = rtrim(inStr.toStringType(), extra) +fun rtrim(inStr: String, extra: TypeExpression? = null) = rtrim(inStr.toDopeType(), extra) -fun rtrim(inStr: String, extra: Char) = rtrim(inStr.toStringType(), extra.toString().toStringType()) +fun rtrim(inStr: String, extra: Char) = rtrim(inStr.toDopeType(), extra.toString().toDopeType()) -fun rtrim(inStr: String, extra: String) = rtrim(inStr.toStringType(), extra.toStringType()) +fun rtrim(inStr: String, extra: String) = rtrim(inStr.toDopeType(), extra.toDopeType()) -fun rtrim(inStr: TypeExpression, extra: Char) = rtrim(inStr, extra.toString().toStringType()) +fun rtrim(inStr: TypeExpression, extra: Char) = rtrim(inStr, extra.toString().toDopeType()) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/SplitExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/SplitExpression.kt index eb65dd44..a6c439bc 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/SplitExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/SplitExpression.kt @@ -2,7 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.FunctionOperator import ch.ergon.dope.validtype.StringType @@ -22,12 +22,12 @@ class SplitExpression( fun split(inStr: TypeExpression, inSubstring: TypeExpression? = null) = SplitExpression(inStr, inSubstring) -fun split(inStr: String): SplitExpression = split(inStr.toStringType()) +fun split(inStr: String): SplitExpression = split(inStr.toDopeType()) fun split(inStr: TypeExpression): SplitExpression = SplitExpression(inStr) -fun split(inStr: String, inSubstring: String? = null): SplitExpression = split(inStr.toStringType(), inSubstring?.toStringType()) +fun split(inStr: String, inSubstring: String? = null): SplitExpression = split(inStr.toDopeType(), inSubstring?.toDopeType()) -fun split(inStr: TypeExpression, inSubstring: String? = null): SplitExpression = split(inStr, inSubstring?.toStringType()) +fun split(inStr: TypeExpression, inSubstring: String? = null): SplitExpression = split(inStr, inSubstring?.toDopeType()) -fun split(inStr: String, inSubstring: TypeExpression? = null) = split(inStr.toStringType(), inSubstring) +fun split(inStr: String, inSubstring: TypeExpression? = null) = split(inStr.toDopeType(), inSubstring) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/SubstringExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/SubstringExpression.kt index 28ee1bd3..54245383 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/SubstringExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/SubstringExpression.kt @@ -2,8 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.FunctionOperator import ch.ergon.dope.validtype.StringType @@ -18,8 +17,8 @@ class SubstringExpression( queryString = toFunctionQueryString( symbol = "SUBSTR", inStrDopeQuery, - startPos.toNumberType().toDopeQuery(), - length.toNumberType().toDopeQuery(), + startPos.toDopeType().toDopeQuery(), + length.toDopeType().toDopeQuery(), ), parameters = inStrDopeQuery.parameters, ) @@ -29,4 +28,4 @@ class SubstringExpression( fun substr(inStr: TypeExpression, startPos: Int, length: Int = inStr.toDopeQuery().queryString.length) = SubstringExpression(inStr, startPos, length) -fun substr(inStr: String, startPos: Int, length: Int = inStr.length): SubstringExpression = substr(inStr.toStringType(), startPos, length) +fun substr(inStr: String, startPos: Int, length: Int = inStr.length): SubstringExpression = substr(inStr.toDopeType(), startPos, length) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/SuffixesExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/SuffixesExpression.kt index 54573fb7..8518b07b 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/SuffixesExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/SuffixesExpression.kt @@ -2,7 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.FunctionOperator import ch.ergon.dope.validtype.StringType @@ -20,4 +20,4 @@ class SuffixesExpression( fun suffixes(inStr: TypeExpression) = SuffixesExpression(inStr) -fun suffixes(inStr: String): SuffixesExpression = suffixes(inStr.toStringType()) +fun suffixes(inStr: String): SuffixesExpression = suffixes(inStr.toDopeType()) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/TrimExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/TrimExpression.kt index 88d46c99..a4ecba42 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/TrimExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/TrimExpression.kt @@ -2,7 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.FunctionOperator import ch.ergon.dope.validtype.StringType @@ -23,10 +23,10 @@ class TrimExpression( fun trim(inStr: TypeExpression, char: TypeExpression? = null) = TrimExpression(inStr, char) -fun trim(inStr: TypeExpression, char: Char) = trim(inStr, char.toString().toStringType()) +fun trim(inStr: TypeExpression, char: Char) = trim(inStr, char.toString().toDopeType()) -fun trim(inStr: String, char: TypeExpression? = null) = trim(inStr.toStringType(), char) +fun trim(inStr: String, char: TypeExpression? = null) = trim(inStr.toDopeType(), char) -fun trim(inStr: String, char: String) = trim(inStr.toStringType(), char.toStringType()) +fun trim(inStr: String, char: String) = trim(inStr.toDopeType(), char.toDopeType()) -fun trim(inStr: String, char: Char) = trim(inStr.toStringType(), char.toString().toStringType()) +fun trim(inStr: String, char: Char) = trim(inStr.toDopeType(), char.toString().toDopeType()) diff --git a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/UpperExpression.kt b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/UpperExpression.kt index 36488f66..3c481659 100644 --- a/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/UpperExpression.kt +++ b/core/src/main/kotlin/ch/ergon/dope/resolvable/expression/unaliased/type/stringfunction/UpperExpression.kt @@ -2,7 +2,7 @@ package ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction import ch.ergon.dope.DopeQuery import ch.ergon.dope.resolvable.expression.TypeExpression -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.operator.FunctionOperator import ch.ergon.dope.validtype.StringType @@ -20,4 +20,4 @@ class UpperExpression( fun upper(inStr: TypeExpression) = UpperExpression(inStr) -fun upper(inStr: String): UpperExpression = upper(inStr.toStringType()) +fun upper(inStr: String): UpperExpression = upper(inStr.toDopeType()) diff --git a/core/src/test/kotlin/ch/ergon/dope/ArrayTest.kt b/core/src/test/kotlin/ch/ergon/dope/ArrayTest.kt index 43e186c6..717a07c8 100644 --- a/core/src/test/kotlin/ch/ergon/dope/ArrayTest.kt +++ b/core/src/test/kotlin/ch/ergon/dope/ArrayTest.kt @@ -14,10 +14,7 @@ import ch.ergon.dope.resolvable.expression.unaliased.type.arithmetic.add import ch.ergon.dope.resolvable.expression.unaliased.type.relational.inArray import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isEqualTo import ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction.concat -import ch.ergon.dope.resolvable.expression.unaliased.type.toArrayType -import ch.ergon.dope.resolvable.expression.unaliased.type.toBooleanType -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import junit.framework.TestCase.assertEquals import kotlin.test.BeforeTest import kotlin.test.Test @@ -37,7 +34,7 @@ class ArrayTest { val actual: String = create .select( - listOf(someStringField("fname", person), someStringField()).toArrayType(), + listOf(someStringField("fname", person), someStringField()).toDopeType(), ).from( person, ).build().queryString @@ -52,8 +49,8 @@ class ArrayTest { val actual: String = create .select( - listOf(someStringField()).toArrayType(), - listOf(someStringField()).toArrayType(), + listOf(someStringField()).toDopeType(), + listOf(someStringField()).toDopeType(), ).from( person, ).build().queryString @@ -69,13 +66,13 @@ class ArrayTest { val actual: String = create .select( listOf( - "test".toStringType(), - 53.toNumberType(), + "test".toDopeType(), + 53.toDopeType(), TRUE, someStringField(), someNumberField("age", person), someBooleanField(), - ).toArrayType(), + ).toDopeType(), ).from( person, ).build().queryString @@ -90,7 +87,7 @@ class ArrayTest { val actual: String = create .select( - listOf(someStringField()).toArrayType().alias("test"), + listOf(someStringField()).toDopeType().alias("test"), ).from( person, ).build().queryString @@ -105,8 +102,8 @@ class ArrayTest { val actual: String = create .select( - listOf(someStringField()).toArrayType().alias("fname"), - listOf(someStringField()).toArrayType().alias("true"), + listOf(someStringField()).toDopeType().alias("fname"), + listOf(someStringField()).toDopeType().alias("true"), ).from( person, ).build().queryString @@ -126,10 +123,10 @@ class ArrayTest { listOf( someNumberField("age", person), TRUE, - "string".toStringType(), - ).toArrayType(), - 23.toNumberType(), - ).toArrayType().alias("test"), + "string".toDopeType(), + ).toDopeType(), + 23.toDopeType(), + ).toDopeType().alias("test"), ).from( person, ).build().queryString @@ -145,9 +142,9 @@ class ArrayTest { val actual: String = create .select( listOf( - "string".toStringType(), - "hallo".toStringType(), - ).toArrayType(), + "string".toDopeType(), + "hallo".toDopeType(), + ).toDopeType(), ).from( person, ).build().queryString @@ -163,10 +160,10 @@ class ArrayTest { val actual: String = create .select( listOf( - concat("string".toStringType(), someStringField()), - "hallo".toStringType(), - ).toArrayType().alias("test"), - 23.toNumberType(), + concat("string".toDopeType(), someStringField()), + "hallo".toDopeType(), + ).toDopeType().alias("test"), + 23.toDopeType(), ).from( person, ).build().queryString @@ -184,7 +181,7 @@ class ArrayTest { TRUE.inArray( listOf( FALSE, - ).toArrayType(), + ).toDopeType(), ), ).from( person, @@ -203,7 +200,7 @@ class ArrayTest { TRUE.inArray( listOf( FALSE, - ).toArrayType(), + ).toDopeType(), ).alias("test"), ).from( person, @@ -221,7 +218,7 @@ class ArrayTest { true.inArray( listOf( FALSE, - true.toBooleanType(), + true.toDopeType(), ), ).alias("test"), ).from( @@ -240,7 +237,7 @@ class ArrayTest { "test".inArray( listOf( someStringField(), - "string".toStringType(), + "string".toDopeType(), ), ).alias("test"), ).from( @@ -259,7 +256,7 @@ class ArrayTest { 3.inArray( listOf( someNumberField(), - 23.toNumberType(), + 23.toDopeType(), ), ).alias("test"), ).from( @@ -277,7 +274,7 @@ class ArrayTest { .select( someNumberField().inArray( listOf( - 23.toNumberType(), + 23.toDopeType(), ), ).alias("test"), ).from( @@ -298,9 +295,9 @@ class ArrayTest { ).where( someStringField().inArray( listOf( - "string".toStringType(), - "hallo".toStringType(), - ).toArrayType(), + "string".toDopeType(), + "hallo".toDopeType(), + ).toDopeType(), ), ).build().queryString @@ -313,7 +310,7 @@ class ArrayTest { val actual: String = create .select( - someNumberArrayField().get(0.toNumberType()), + someNumberArrayField().get(0.toDopeType()), ).from( someBucket(), ).build().queryString @@ -327,7 +324,7 @@ class ArrayTest { val actual: String = create .select( - someNumberArrayField().get(1.toNumberType().add(1)), + someNumberArrayField().get(1.toDopeType().add(1)), ).from( someBucket(), ).build().queryString @@ -341,7 +338,7 @@ class ArrayTest { val actual: String = create .select( - someNumberArrayField().get((-1).toNumberType()), + someNumberArrayField().get((-1).toDopeType()), ).from( someBucket(), ).build().queryString @@ -355,7 +352,7 @@ class ArrayTest { val actual: String = create .select( - someStringArrayField().get(someNumberArrayField().get(0.toNumberType())), + someStringArrayField().get(someNumberArrayField().get(0.toDopeType())), ).from( someBucket(), ).build().queryString @@ -371,7 +368,7 @@ class ArrayTest { .selectAsterisk().from( someBucket(), ).where( - someNumberArrayField().get(0.toNumberType()).isEqualTo(1), + someNumberArrayField().get(0.toDopeType()).isEqualTo(1), ).build().queryString assertEquals(expected, actual) @@ -385,7 +382,7 @@ class ArrayTest { .selectAsterisk().from( someBucket(), ).offset( - someNumberArrayField().get(0.toNumberType()), + someNumberArrayField().get(0.toDopeType()), ).build().queryString assertEquals(expected, actual) @@ -399,7 +396,7 @@ class ArrayTest { .selectAsterisk().from( someBucket(), ).limit( - someNumberArrayField().get(0.toNumberType()), + someNumberArrayField().get(0.toDopeType()), ).build().queryString assertEquals(expected, actual) diff --git a/core/src/test/kotlin/ch/ergon/dope/BooleanComparatorTest.kt b/core/src/test/kotlin/ch/ergon/dope/BooleanComparatorTest.kt index 845794ec..0ff2cdf0 100644 --- a/core/src/test/kotlin/ch/ergon/dope/BooleanComparatorTest.kt +++ b/core/src/test/kotlin/ch/ergon/dope/BooleanComparatorTest.kt @@ -20,9 +20,7 @@ import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isNotNull import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isNotValued import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isNull import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isValued -import ch.ergon.dope.resolvable.expression.unaliased.type.toBooleanType -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import org.junit.jupiter.api.Assertions.assertEquals import kotlin.test.BeforeTest import kotlin.test.Test @@ -44,7 +42,7 @@ class BooleanComparatorTest { val actual = create .selectFrom(someBucket()) .where( - someNumberField().isGreaterThan(5.toNumberType()), + someNumberField().isGreaterThan(5.toDopeType()), ).build().queryString assertEquals(expected, actual) @@ -74,7 +72,7 @@ class BooleanComparatorTest { .from( someBucket(), ).where( - 2.isGreaterThan(4.toNumberType()), + 2.isGreaterThan(4.toDopeType()), ).build().queryString assertEquals(expected, actual) @@ -89,7 +87,7 @@ class BooleanComparatorTest { .from( someBucket(), ).where( - 2.toNumberType().isGreaterThan(4), + 2.toDopeType().isGreaterThan(4), ).build().queryString assertEquals(expected, actual) @@ -102,7 +100,7 @@ class BooleanComparatorTest { val actual = create .selectFrom(someBucket()) .where( - someStringField().isGreaterThan("a".toStringType()), + someStringField().isGreaterThan("a".toDopeType()), ).build().queryString assertEquals(expected, actual) @@ -132,7 +130,7 @@ class BooleanComparatorTest { .from( someBucket(), ).where( - "hallo".toStringType().isGreaterThan("test"), + "hallo".toDopeType().isGreaterThan("test"), ).build().queryString assertEquals(expected, actual) @@ -147,7 +145,7 @@ class BooleanComparatorTest { .from( someBucket(), ).where( - "hallo".isGreaterThan("test".toStringType()), + "hallo".isGreaterThan("test".toDopeType()), ).build().queryString assertEquals(expected, actual) @@ -160,7 +158,7 @@ class BooleanComparatorTest { val actual = create .selectFrom(someBucket()) .where( - "a".toStringType().isGreaterThan(someStringField()), + "a".toDopeType().isGreaterThan(someStringField()), ).build().queryString assertEquals(expected, actual) @@ -174,7 +172,7 @@ class BooleanComparatorTest { .selectFrom( someBucket(), ).where( - someNumberField().isLessThan(5.toNumberType()), + someNumberField().isLessThan(5.toDopeType()), ).build().queryString assertEquals(expected, actual) @@ -187,7 +185,7 @@ class BooleanComparatorTest { val actual = create .selectFrom(someBucket()) .where( - 5.toNumberType().isLessThan(someNumberField()), + 5.toDopeType().isLessThan(someNumberField()), ).build().queryString assertEquals(expected, actual) @@ -217,7 +215,7 @@ class BooleanComparatorTest { .from( someBucket(), ).where( - 5.toNumberType().isLessThan(7), + 5.toDopeType().isLessThan(7), ).build().queryString assertEquals(expected, actual) @@ -232,7 +230,7 @@ class BooleanComparatorTest { .from( someBucket(), ).where( - 5.isLessThan(7.toNumberType()), + 5.isLessThan(7.toDopeType()), ).build().queryString assertEquals(expected, actual) @@ -245,7 +243,7 @@ class BooleanComparatorTest { val actual = create .selectFrom(someBucket()) .where( - someStringField().isLessThan("a".toStringType()), + someStringField().isLessThan("a".toDopeType()), ).build().queryString assertEquals(expected, actual) @@ -275,7 +273,7 @@ class BooleanComparatorTest { .from( someBucket(), ).where( - "hallo".toStringType().isLessThan("test"), + "hallo".toDopeType().isLessThan("test"), ).build().queryString assertEquals(expected, actual) @@ -290,7 +288,7 @@ class BooleanComparatorTest { .from( someBucket(), ).where( - "hallo".isLessThan("test".toStringType()), + "hallo".isLessThan("test".toDopeType()), ).build().queryString assertEquals(expected, actual) @@ -316,7 +314,7 @@ class BooleanComparatorTest { val actual = create .selectFrom(someBucket()) .where( - someStringField().isLike("_b%".toStringType()), + someStringField().isLike("_b%".toDopeType()), ).build().queryString assertEquals(expected, actual) @@ -342,7 +340,7 @@ class BooleanComparatorTest { val actual = create .selectFrom(someBucket()) .where( - someStringField().isNotLike("_b%".toStringType()), + someStringField().isNotLike("_b%".toDopeType()), ).build().queryString assertEquals(expected, actual) @@ -434,7 +432,7 @@ class BooleanComparatorTest { .selectAsterisk() .from(someBucket()) .where( - 12.toNumberType().isNotEqualTo(5.toNumberType()), + 12.toDopeType().isNotEqualTo(5.toDopeType()), ).build().queryString kotlin.test.assertEquals(expected, actual) @@ -462,7 +460,7 @@ class BooleanComparatorTest { .selectAsterisk() .from(someBucket()) .where( - 12.toNumberType().isNotEqualTo(5), + 12.toDopeType().isNotEqualTo(5), ).build().queryString kotlin.test.assertEquals(expected, actual) @@ -476,7 +474,7 @@ class BooleanComparatorTest { .selectAsterisk() .from(someBucket()) .where( - 12.isNotEqualTo(5.toNumberType()), + 12.isNotEqualTo(5.toDopeType()), ).build().queryString kotlin.test.assertEquals(expected, actual) @@ -490,7 +488,7 @@ class BooleanComparatorTest { .selectAsterisk() .from(someBucket()) .where( - someNumberField().isNotEqualTo(5.toNumberType()), + someNumberField().isNotEqualTo(5.toDopeType()), ).build().queryString kotlin.test.assertEquals(expected, actual) @@ -504,7 +502,7 @@ class BooleanComparatorTest { .selectAsterisk() .from(someBucket()) .where( - 3.toNumberType().isNotEqualTo(someNumberField()), + 3.toDopeType().isNotEqualTo(someNumberField()), ).build().queryString kotlin.test.assertEquals(expected, actual) @@ -518,7 +516,7 @@ class BooleanComparatorTest { .selectAsterisk() .from(someBucket()) .where( - "test".toStringType().isNotEqualTo("hallo".toStringType()), + "test".toDopeType().isNotEqualTo("hallo".toDopeType()), ).build().queryString kotlin.test.assertEquals(expected, actual) @@ -532,7 +530,7 @@ class BooleanComparatorTest { .selectAsterisk() .from(someBucket()) .where( - someStringField().isNotEqualTo("5".toStringType()), + someStringField().isNotEqualTo("5".toDopeType()), ).build().queryString kotlin.test.assertEquals(expected, actual) @@ -546,7 +544,7 @@ class BooleanComparatorTest { .selectAsterisk() .from(someBucket()) .where( - 12.toNumberType().isGreaterOrEqualThan(5.toNumberType()), + 12.toDopeType().isGreaterOrEqualThan(5.toDopeType()), ).build().queryString kotlin.test.assertEquals(expected, actual) @@ -560,7 +558,7 @@ class BooleanComparatorTest { .selectAsterisk() .from(someBucket()) .where( - 12.isGreaterOrEqualThan(5.toNumberType()), + 12.isGreaterOrEqualThan(5.toDopeType()), ).build().queryString kotlin.test.assertEquals(expected, actual) @@ -574,7 +572,7 @@ class BooleanComparatorTest { .selectAsterisk() .from(someBucket()) .where( - 12.toNumberType().isGreaterOrEqualThan(5), + 12.toDopeType().isGreaterOrEqualThan(5), ).build().queryString kotlin.test.assertEquals(expected, actual) @@ -588,7 +586,7 @@ class BooleanComparatorTest { .selectAsterisk() .from(someBucket()) .where( - "hallo".isGreaterOrEqualThan("test".toStringType()), + "hallo".isGreaterOrEqualThan("test".toDopeType()), ).build().queryString kotlin.test.assertEquals(expected, actual) @@ -616,7 +614,7 @@ class BooleanComparatorTest { .selectAsterisk() .from(someBucket()) .where( - someNumberField().isGreaterOrEqualThan(5.toNumberType()), + someNumberField().isGreaterOrEqualThan(5.toDopeType()), ).build().queryString kotlin.test.assertEquals(expected, actual) @@ -630,7 +628,7 @@ class BooleanComparatorTest { .selectAsterisk() .from(someBucket()) .where( - 3.toNumberType().isGreaterOrEqualThan(someNumberField()), + 3.toDopeType().isGreaterOrEqualThan(someNumberField()), ).build().queryString kotlin.test.assertEquals(expected, actual) @@ -644,7 +642,7 @@ class BooleanComparatorTest { .selectAsterisk() .from(someBucket()) .where( - "test".toStringType().isGreaterOrEqualThan("hallo".toStringType()), + "test".toDopeType().isGreaterOrEqualThan("hallo".toDopeType()), ).build().queryString kotlin.test.assertEquals(expected, actual) @@ -658,7 +656,7 @@ class BooleanComparatorTest { .selectAsterisk() .from(someBucket()) .where( - someStringField().isGreaterOrEqualThan("5".toStringType()), + someStringField().isGreaterOrEqualThan("5".toDopeType()), ).build().queryString kotlin.test.assertEquals(expected, actual) @@ -672,7 +670,7 @@ class BooleanComparatorTest { .selectAsterisk() .from(someBucket()) .where( - "test".toStringType().isGreaterOrEqualThan(someStringField()), + "test".toDopeType().isGreaterOrEqualThan(someStringField()), ).build().queryString kotlin.test.assertEquals(expected, actual) @@ -686,7 +684,7 @@ class BooleanComparatorTest { .selectAsterisk() .from(someBucket()) .where( - 12.toNumberType().isLessOrEqualThan(5.toNumberType()), + 12.toDopeType().isLessOrEqualThan(5.toDopeType()), ).build().queryString kotlin.test.assertEquals(expected, actual) @@ -700,7 +698,7 @@ class BooleanComparatorTest { .selectAsterisk() .from(someBucket()) .where( - someNumberField().isLessOrEqualThan(5.toNumberType()), + someNumberField().isLessOrEqualThan(5.toDopeType()), ).build().queryString kotlin.test.assertEquals(expected, actual) @@ -714,7 +712,7 @@ class BooleanComparatorTest { .selectAsterisk() .from(someBucket()) .where( - 3.toNumberType().isLessOrEqualThan(someNumberField()), + 3.toDopeType().isLessOrEqualThan(someNumberField()), ).build().queryString kotlin.test.assertEquals(expected, actual) @@ -728,7 +726,7 @@ class BooleanComparatorTest { .selectAsterisk() .from(someBucket()) .where( - "test".toStringType().isLessOrEqualThan("hallo".toStringType()), + "test".toDopeType().isLessOrEqualThan("hallo".toDopeType()), ).build().queryString kotlin.test.assertEquals(expected, actual) @@ -742,7 +740,7 @@ class BooleanComparatorTest { .selectAsterisk() .from(someBucket()) .where( - someStringField().isLessOrEqualThan("5".toStringType()), + someStringField().isLessOrEqualThan("5".toDopeType()), ).build().queryString kotlin.test.assertEquals(expected, actual) @@ -759,7 +757,7 @@ class BooleanComparatorTest { someBucket(), ).where( someStringField("email").isLike( - "%@yahoo.com".toStringType(), + "%@yahoo.com".toDopeType(), ), ).build().queryString @@ -777,9 +775,9 @@ class BooleanComparatorTest { someBucket(), ).where( someStringField("email").isLike( - "%@gmail.com".toStringType(), + "%@gmail.com".toDopeType(), ).and( - someNumberField().isEqualTo(46.toNumberType()), + someNumberField().isEqualTo(46.toDopeType()), ), ).build().queryString @@ -797,7 +795,7 @@ class BooleanComparatorTest { @Test fun `should support Number isEqualTo NumberType`() { - val numberExpression = 5.toNumberType() + val numberExpression = 5.toDopeType() val expected = "5 = 5" val actual: String = 5.isEqualTo(numberExpression).toDopeQuery().queryString @@ -807,7 +805,7 @@ class BooleanComparatorTest { @Test fun `should support NumberType isEqualTo Number`() { - val numberExpression = 5.toNumberType() + val numberExpression = 5.toDopeType() val expected = "5 = 5" val actual: String = numberExpression.isEqualTo(5).toDopeQuery().queryString @@ -826,7 +824,7 @@ class BooleanComparatorTest { @Test fun `should support String isEqualTo StringType`() { - val stringExpression = "hello".toStringType() + val stringExpression = "hello".toDopeType() val expected = "\"hello\" = \"hello\"" val actual: String = "hello".isEqualTo(stringExpression).toDopeQuery().queryString @@ -836,7 +834,7 @@ class BooleanComparatorTest { @Test fun `should support StringType isEqualTo String`() { - val stringExpression = "hello".toStringType() + val stringExpression = "hello".toDopeType() val expected = "\"hello\" = \"hello\"" val actual: String = stringExpression.isEqualTo("hello").toDopeQuery().queryString @@ -855,7 +853,7 @@ class BooleanComparatorTest { @Test fun `should support Boolean isEqualTo BooleanType`() { - val booleanExpression = true.toBooleanType() + val booleanExpression = true.toDopeType() val expected = "TRUE = TRUE" val actual: String = true.isEqualTo(booleanExpression).toDopeQuery().queryString @@ -865,7 +863,7 @@ class BooleanComparatorTest { @Test fun `should support BooleanType isEqualTo Boolean`() { - val booleanExpression = true.toBooleanType() + val booleanExpression = true.toDopeType() val expected = "TRUE = TRUE" val actual: String = booleanExpression.isEqualTo(true).toDopeQuery().queryString @@ -882,7 +880,7 @@ class BooleanComparatorTest { someBucket(), ) .where( - true.toBooleanType().and(true), + true.toDopeType().and(true), ) .build().queryString @@ -898,7 +896,7 @@ class BooleanComparatorTest { someBucket(), ) .where( - true.toBooleanType().and(true).or(false), + true.toDopeType().and(true).or(false), ) .build().queryString @@ -914,7 +912,7 @@ class BooleanComparatorTest { someBucket(), ) .where( - true.toBooleanType().and(true.toBooleanType().or(false)), + true.toDopeType().and(true.toDopeType().or(false)), ) .build().queryString diff --git a/core/src/test/kotlin/ch/ergon/dope/DeleteTest.kt b/core/src/test/kotlin/ch/ergon/dope/DeleteTest.kt index ad07bf66..8358f0c1 100644 --- a/core/src/test/kotlin/ch/ergon/dope/DeleteTest.kt +++ b/core/src/test/kotlin/ch/ergon/dope/DeleteTest.kt @@ -6,7 +6,7 @@ import ch.ergon.dope.helper.someStringField import ch.ergon.dope.resolvable.expression.unaliased.type.TRUE import ch.ergon.dope.resolvable.expression.unaliased.type.logical.and import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isEqualTo -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import junit.framework.TestCase.assertEquals import kotlin.test.BeforeTest import kotlin.test.Test @@ -48,7 +48,7 @@ class DeleteTest { val actual: String = create .deleteFrom(someBucket()) - .limit(10.toNumberType()) + .limit(10.toDopeType()) .build().queryString assertEquals(expected, actual) @@ -60,7 +60,7 @@ class DeleteTest { val actual: String = create .deleteFrom(someBucket()) - .offset(10.toNumberType()) + .offset(10.toDopeType()) .build().queryString assertEquals(expected, actual) @@ -97,8 +97,8 @@ class DeleteTest { val actual: String = create .deleteFrom(someBucket()) .where(someNumberField("age", someBucket()).isEqualTo(2).and(TRUE)) - .limit(7.toNumberType()) - .offset(10.toNumberType()) + .limit(7.toDopeType()) + .offset(10.toDopeType()) .returning(someStringField()) .build().queryString diff --git a/core/src/test/kotlin/ch/ergon/dope/JoinClauseTest.kt b/core/src/test/kotlin/ch/ergon/dope/JoinClauseTest.kt index e751509e..48689e1e 100644 --- a/core/src/test/kotlin/ch/ergon/dope/JoinClauseTest.kt +++ b/core/src/test/kotlin/ch/ergon/dope/JoinClauseTest.kt @@ -9,8 +9,7 @@ import ch.ergon.dope.resolvable.expression.unaliased.aggregator.min import ch.ergon.dope.resolvable.expression.unaliased.type.logical.and import ch.ergon.dope.resolvable.expression.unaliased.type.meta.meta import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isEqualTo -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import org.junit.jupiter.api.Assertions.assertEquals import kotlin.test.BeforeTest import kotlin.test.Test @@ -43,7 +42,7 @@ class JoinClauseTest { ), ).where( someStringField("country", airline).isEqualTo( - "France".toStringType(), + "France".toDopeType(), ), ).build().queryString @@ -65,7 +64,7 @@ class JoinClauseTest { meta(airline).id, ), ).where( - someStringField("sourceairport", route).isEqualTo("SFO".toStringType()), + someStringField("sourceairport", route).isEqualTo("SFO".toDopeType()), ).build().queryString assertEquals(unifyString(expected), actual) @@ -89,7 +88,7 @@ class JoinClauseTest { ), ).where( someStringField("sourceairport", route).isEqualTo( - "SFO".toStringType(), + "SFO".toDopeType(), ), ).build().queryString @@ -118,7 +117,7 @@ class JoinClauseTest { ), ).where( someStringField("destinationairport", route).isEqualTo( - "SFO".toStringType(), + "SFO".toDopeType(), ), ).orderBy( someStringField("sourceairport"), @@ -166,7 +165,7 @@ class JoinClauseTest { someStringField("city", lmark), ).and( someStringField("country", lmark).isEqualTo( - "United States".toStringType(), + "United States".toDopeType(), ), ), ).groupBy( @@ -216,7 +215,7 @@ class JoinClauseTest { someStringField("city", lmark), ).and( someStringField("country", lmark).isEqualTo( - "United States".toStringType(), + "United States".toDopeType(), ), ), ).groupBy( @@ -224,7 +223,7 @@ class JoinClauseTest { ).orderBy( someStringField("airportname", aport), ).limit( - 4.toNumberType(), + 4.toDopeType(), ).build().queryString assertEquals(unifyString(expected), actual) @@ -263,10 +262,10 @@ class JoinClauseTest { onKeys = someStringField("airlineid", route), ).where( someStringField("sourceairport", route).isEqualTo( - "SFO".toStringType(), + "SFO".toDopeType(), ).and( someNumberField("stops", route).isEqualTo( - 0.toNumberType(), + 0.toDopeType(), ), ), ).limit( @@ -295,10 +294,10 @@ class JoinClauseTest { onKeys = someStringField("airlineid", route), ).where( someStringField("destinationairport", route).isEqualTo( - "ATL".toStringType(), + "ATL".toDopeType(), ).and( someStringField("sourceairport", route).isEqualTo( - "SEA".toStringType(), + "SEA".toDopeType(), ), ), ).build().queryString @@ -325,7 +324,7 @@ class JoinClauseTest { airline, onKeys = someStringField("airlineid", route), ).where( - someStringField("icao", airline).isEqualTo("SWA".toStringType()), + someStringField("icao", airline).isEqualTo("SWA".toDopeType()), ).limit( 4, ).build().queryString @@ -445,7 +444,7 @@ class JoinClauseTest { airline, onKeys = someStringField("airlineid", route), ).where( - someStringField("icao", airline).isEqualTo("SWA".toStringType()), + someStringField("icao", airline).isEqualTo("SWA".toDopeType()), ).limit( 4, ).build().queryString diff --git a/core/src/test/kotlin/ch/ergon/dope/NumberFunctionsTest.kt b/core/src/test/kotlin/ch/ergon/dope/NumberFunctionsTest.kt index 99e50c0c..c86fc9a6 100644 --- a/core/src/test/kotlin/ch/ergon/dope/NumberFunctionsTest.kt +++ b/core/src/test/kotlin/ch/ergon/dope/NumberFunctionsTest.kt @@ -1,7 +1,7 @@ package ch.ergon.dope import ch.ergon.dope.resolvable.expression.alias -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import junit.framework.TestCase.assertEquals import kotlin.test.BeforeTest import kotlin.test.Test @@ -22,7 +22,7 @@ class NumberFunctionsTest { val actual: String = create .select( - 12.toNumberType().alias("someNumber"), + 12.toDopeType().alias("someNumber"), ).build().queryString assertEquals(expected, actual) diff --git a/core/src/test/kotlin/ch/ergon/dope/OperatorTest.kt b/core/src/test/kotlin/ch/ergon/dope/OperatorTest.kt index 8a91bd27..af225095 100644 --- a/core/src/test/kotlin/ch/ergon/dope/OperatorTest.kt +++ b/core/src/test/kotlin/ch/ergon/dope/OperatorTest.kt @@ -9,7 +9,7 @@ import ch.ergon.dope.resolvable.expression.unaliased.type.arithmetic.mod import ch.ergon.dope.resolvable.expression.unaliased.type.arithmetic.mul import ch.ergon.dope.resolvable.expression.unaliased.type.arithmetic.neg import ch.ergon.dope.resolvable.expression.unaliased.type.arithmetic.sub -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import junit.framework.TestCase.assertEquals import kotlin.test.BeforeTest import kotlin.test.Test @@ -31,7 +31,7 @@ class OperatorTest { val actual: String = create .select( - 2.toNumberType().add(5.toNumberType()), + 2.toDopeType().add(5.toDopeType()), ).from( someBucket, ).build().queryString @@ -87,7 +87,7 @@ class OperatorTest { val actual: String = create .select( - someNumberField().add(5.toNumberType()), + someNumberField().add(5.toDopeType()), ).from( someBucket, ).build().queryString @@ -101,7 +101,7 @@ class OperatorTest { val actual: String = create .select( - 3.toNumberType().add(someNumberField().add(5.toNumberType())), + 3.toDopeType().add(someNumberField().add(5.toDopeType())), ).from( someBucket, ).build().queryString @@ -115,7 +115,7 @@ class OperatorTest { val actual: String = create .select( - someNumberField().add(5.toNumberType()).alias("something"), + someNumberField().add(5.toDopeType()).alias("something"), ).from( someBucket, ).build().queryString @@ -129,7 +129,7 @@ class OperatorTest { val actual: String = create .select( - 13.toNumberType().sub(6.toNumberType()), + 13.toDopeType().sub(6.toDopeType()), ).from( someBucket, ).build().queryString @@ -185,7 +185,7 @@ class OperatorTest { val actual: String = create .select( - someNumberField().sub(2.toNumberType()), + someNumberField().sub(2.toDopeType()), ).from( someBucket, ).build().queryString @@ -199,7 +199,7 @@ class OperatorTest { val actual: String = create .select( - 9.toNumberType().sub(someNumberField().sub(2.toNumberType())), + 9.toDopeType().sub(someNumberField().sub(2.toDopeType())), ).from( someBucket, ).build().queryString @@ -213,7 +213,7 @@ class OperatorTest { val actual: String = create .select( - someNumberField().sub(5.toNumberType()).alias("something"), + someNumberField().sub(5.toDopeType()).alias("something"), ).from( someBucket, ).build().queryString @@ -227,7 +227,7 @@ class OperatorTest { val actual: String = create .select( - 13.toNumberType().mul(6.toNumberType()), + 13.toDopeType().mul(6.toDopeType()), ).from( someBucket, ).build().queryString @@ -283,7 +283,7 @@ class OperatorTest { val actual: String = create .select( - someNumberField().mul(2.toNumberType()), + someNumberField().mul(2.toDopeType()), ).from( someBucket, ).build().queryString @@ -297,7 +297,7 @@ class OperatorTest { val actual: String = create .select( - 9.toNumberType().mul(someNumberField().mul(2.toNumberType())), + 9.toDopeType().mul(someNumberField().mul(2.toDopeType())), ).from( someBucket, ).build().queryString @@ -311,7 +311,7 @@ class OperatorTest { val actual: String = create .select( - someNumberField().mul(5.toNumberType()).alias("something"), + someNumberField().mul(5.toDopeType()).alias("something"), ).from( someBucket, ).build().queryString @@ -325,7 +325,7 @@ class OperatorTest { val actual: String = create .select( - 13.toNumberType().div(6.toNumberType()), + 13.toDopeType().div(6.toDopeType()), ).from( someBucket, ).build().queryString @@ -367,7 +367,7 @@ class OperatorTest { val actual: String = create .select( - someNumberField().div(2.toNumberType()), + someNumberField().div(2.toDopeType()), ).from( someBucket, ).build().queryString @@ -381,7 +381,7 @@ class OperatorTest { val actual: String = create .select( - 9.toNumberType().div(someNumberField().div(2.toNumberType())), + 9.toDopeType().div(someNumberField().div(2.toDopeType())), ).from( someBucket, ).build().queryString @@ -395,7 +395,7 @@ class OperatorTest { val actual: String = create .select( - someNumberField().div(5.toNumberType()).alias("something"), + someNumberField().div(5.toDopeType()).alias("something"), ).from( someBucket, ).build().queryString @@ -409,7 +409,7 @@ class OperatorTest { val actual: String = create .select( - 13.toNumberType().mod(6.toNumberType()), + 13.toDopeType().mod(6.toDopeType()), ).from( someBucket, ).build().queryString @@ -465,7 +465,7 @@ class OperatorTest { val actual: String = create .select( - someNumberField().mod(2.toNumberType()), + someNumberField().mod(2.toDopeType()), ).from( someBucket, ).build().queryString @@ -479,7 +479,7 @@ class OperatorTest { val actual: String = create .select( - 9.toNumberType().mod(someNumberField().mod(2.toNumberType())), + 9.toDopeType().mod(someNumberField().mod(2.toDopeType())), ).from( someBucket, ).build().queryString @@ -493,7 +493,7 @@ class OperatorTest { val actual: String = create .select( - someNumberField().mod(5.toNumberType()).alias("something"), + someNumberField().mod(5.toDopeType()).alias("something"), ).from( someBucket, ).build().queryString @@ -521,7 +521,7 @@ class OperatorTest { val actual: String = create .select( - neg(someNumberField().mul(12.toNumberType())), + neg(someNumberField().mul(12.toDopeType())), ).from( someBucket, ).build().queryString @@ -535,7 +535,7 @@ class OperatorTest { val actual: String = create .select( - neg(someNumberField()).add(6.toNumberType()), + neg(someNumberField()).add(6.toDopeType()), ).from( someBucket, ).build().queryString @@ -549,16 +549,16 @@ class OperatorTest { val actual: String = create .select( - 12.toNumberType().add( + 12.toDopeType().add( neg(someNumberField()).mod( - 12.toNumberType().mul( + 12.toDopeType().mul( neg( someNumberField().sub( - neg(12.toNumberType()), + neg(12.toDopeType()), ), ), ).add( - 6.toNumberType(), + 6.toDopeType(), ), ), ).alias("calculation"), @@ -575,12 +575,12 @@ class OperatorTest { val actual: String = create .select( - 9.toNumberType().mul( - 15.toNumberType().sub( - 19.toNumberType().div(4.toNumberType()), + 9.toDopeType().mul( + 15.toDopeType().sub( + 19.toDopeType().div(4.toDopeType()), ).add( - 21.toNumberType().mul( - 12.toNumberType().sub(59.toNumberType()), + 21.toDopeType().mul( + 12.toDopeType().sub(59.toDopeType()), ), ), ).alias("calculation"), @@ -597,7 +597,7 @@ class OperatorTest { val actual: String = create .select( - neg(6.toNumberType()), + neg(6.toDopeType()), ).from( someBucket, ).build().queryString diff --git a/core/src/test/kotlin/ch/ergon/dope/ParameterizedQueriesTest.kt b/core/src/test/kotlin/ch/ergon/dope/ParameterizedQueriesTest.kt index 1c769961..9c289566 100644 --- a/core/src/test/kotlin/ch/ergon/dope/ParameterizedQueriesTest.kt +++ b/core/src/test/kotlin/ch/ergon/dope/ParameterizedQueriesTest.kt @@ -12,8 +12,7 @@ import ch.ergon.dope.resolvable.expression.unaliased.type.logical.or import ch.ergon.dope.resolvable.expression.unaliased.type.relational.inArray import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isEqualTo import ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction.concat -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import junit.framework.TestCase.assertEquals import kotlin.test.BeforeTest import kotlin.test.Test @@ -31,7 +30,7 @@ class ParameterizedQueriesTest { val expected = "SELECT $1 = 1" val positionalParameterActual = 1.asParameter() - val actual = create.select(positionalParameterActual.isEqualTo(1.toNumberType())).build().queryString + val actual = create.select(positionalParameterActual.isEqualTo(1.toDopeType())).build().queryString assertEquals(unifyString(expected), actual) } @@ -42,7 +41,7 @@ class ParameterizedQueriesTest { val actual = create.select( "hello".asParameter("greeting") - .isEqualTo("hello".toStringType()), + .isEqualTo("hello".toDopeType()), ).build().queryString assertEquals( @@ -55,7 +54,7 @@ class ParameterizedQueriesTest { fun `should Support Named Parameters As Key But Missing`() { val expected = "There are more parameters in the query than were passed" try { - create.select("hello".asParameter("greeting").isEqualTo("hello".toStringType())).build() + create.select("hello".asParameter("greeting").isEqualTo("hello".toDopeType())).build() } catch (e: Exception) { assertEquals(expected, e.message) } diff --git a/core/src/test/kotlin/ch/ergon/dope/ParameterizedTest.kt b/core/src/test/kotlin/ch/ergon/dope/ParameterizedTest.kt index 4ff93687..c914aa7c 100644 --- a/core/src/test/kotlin/ch/ergon/dope/ParameterizedTest.kt +++ b/core/src/test/kotlin/ch/ergon/dope/ParameterizedTest.kt @@ -8,8 +8,7 @@ import ch.ergon.dope.resolvable.expression.unaliased.type.logical.or import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isEqualTo import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isNotEqualTo import ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction.concat -import ch.ergon.dope.resolvable.expression.unaliased.type.toArrayType -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import junit.framework.TestCase.assertEquals import org.junit.jupiter.api.BeforeEach import kotlin.test.Test @@ -33,7 +32,7 @@ class ParameterizedTest { fun `should get one parameter as result`() { val parameter = 1.asParameter("test") - val parameters = create.select(parameter.isEqualTo(1.toNumberType())).build().parameters + val parameters = create.select(parameter.isEqualTo(1.toDopeType())).build().parameters assertEquals(1, parameters.size) } @@ -145,7 +144,7 @@ class ParameterizedTest { val parameterValue = 3 val parameter = parameterValue.asParameter() - val parameters = create.select(listOf(parameter).toArrayType()).build().parameters + val parameters = create.select(listOf(parameter).toDopeType()).build().parameters assertEquals(parameterValue, parameters["$1"]) assertEquals(1, parameters.size) diff --git a/core/src/test/kotlin/ch/ergon/dope/QueryBuilderTest.kt b/core/src/test/kotlin/ch/ergon/dope/QueryBuilderTest.kt index 497a534d..3d7d70fc 100644 --- a/core/src/test/kotlin/ch/ergon/dope/QueryBuilderTest.kt +++ b/core/src/test/kotlin/ch/ergon/dope/QueryBuilderTest.kt @@ -19,9 +19,7 @@ import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isLessThan import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isLike import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isNotEqualTo import ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction.nowStr -import ch.ergon.dope.resolvable.expression.unaliased.type.toBooleanType -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.fromable.asterisk import kotlin.test.BeforeTest import kotlin.test.Test @@ -59,7 +57,7 @@ class QueryBuilderTest { .from( someBucket(), ).where( - someStringField().isEqualTo("Ian".toStringType()), + someStringField().isEqualTo("Ian".toDopeType()), ).build().queryString assertEquals(unifyString(expected), actual) @@ -72,7 +70,7 @@ class QueryBuilderTest { val actual: String = create.selectFrom( someBucket(), ).where( - someStringField().isEqualTo("Ian".toStringType()), + someStringField().isEqualTo("Ian".toDopeType()), ).build().queryString assertEquals(unifyString(expected), actual) @@ -87,7 +85,7 @@ class QueryBuilderTest { .from( someBucket(), ).where( - someStringField().isEqualTo("Ian".toStringType()), + someStringField().isEqualTo("Ian".toDopeType()), ).build().queryString assertEquals(unifyString(expected), actual) @@ -103,7 +101,7 @@ class QueryBuilderTest { ).from( someBucket(), ).where( - someStringField().isEqualTo("Ian".toStringType()), + someStringField().isEqualTo("Ian".toDopeType()), ).build().queryString assertEquals(unifyString(expected), actual) @@ -118,7 +116,7 @@ class QueryBuilderTest { ).from( someBucket(), ).where( - someStringField().isEqualTo("Peter".toStringType()), + someStringField().isEqualTo("Peter".toDopeType()), ).build().queryString assertEquals(unifyString(expected), actual) @@ -133,7 +131,7 @@ class QueryBuilderTest { someStringField().alias("FirstName"), someStringField(), ).from(someBucket()).where( - someStringField().isEqualTo("Jackson".toStringType()), + someStringField().isEqualTo("Jackson".toDopeType()), ).build().queryString assertEquals(unifyString(expected), actual) @@ -148,7 +146,7 @@ class QueryBuilderTest { someStringField(), someStringField().alias("LastName"), ).from(someBucket()).where( - someStringField().isEqualTo("Jackson".toStringType()), + someStringField().isEqualTo("Jackson".toDopeType()), ).build().queryString assertEquals(unifyString(expected), actual) @@ -163,7 +161,7 @@ class QueryBuilderTest { .from( someBucket(), ).where( - someNumberField().isLessThan(50.toNumberType()), + someNumberField().isLessThan(50.toDopeType()), ).build().queryString assertEquals(unifyString(expected), actual) @@ -178,8 +176,8 @@ class QueryBuilderTest { .from( someBucket(), ).where( - someNumberField().isLessThan(50.toNumberType()).and( - someStringField().isEqualTo("Mr.".toStringType()), + someNumberField().isLessThan(50.toDopeType()).and( + someStringField().isEqualTo("Mr.".toDopeType()), ), ).build().queryString @@ -196,10 +194,10 @@ class QueryBuilderTest { someBucket(), ).where( someNumberField().isLessThan( - (45 + 5).toNumberType(), + (45 + 5).toDopeType(), ).and( someStringField().isEqualTo( - ("M" + "r.").toStringType(), + ("M" + "r.").toDopeType(), ), ), ).build().queryString @@ -215,7 +213,7 @@ class QueryBuilderTest { .selectAsterisk() .from(someBucket()) .where( - 12.toNumberType().isNotEqualTo(5.toNumberType()), + 12.toDopeType().isNotEqualTo(5.toDopeType()), ).build().queryString assertEquals(expected, actual) @@ -229,7 +227,7 @@ class QueryBuilderTest { .selectAsterisk() .from(someBucket()) .where( - someNumberField().isNotEqualTo(5.toNumberType()), + someNumberField().isNotEqualTo(5.toDopeType()), ).build().queryString assertEquals(expected, actual) @@ -243,7 +241,7 @@ class QueryBuilderTest { .selectAsterisk() .from(someBucket()) .where( - 3.toNumberType().isNotEqualTo(someNumberField()), + 3.toDopeType().isNotEqualTo(someNumberField()), ).build().queryString assertEquals(expected, actual) @@ -257,7 +255,7 @@ class QueryBuilderTest { .selectAsterisk() .from(someBucket()) .where( - "test".toStringType().isNotEqualTo("hallo".toStringType()), + "test".toDopeType().isNotEqualTo("hallo".toDopeType()), ).build().queryString assertEquals(expected, actual) @@ -271,7 +269,7 @@ class QueryBuilderTest { .selectAsterisk() .from(someBucket()) .where( - someStringField().isNotEqualTo("5".toStringType()), + someStringField().isNotEqualTo("5".toDopeType()), ).build().queryString assertEquals(expected, actual) @@ -285,7 +283,7 @@ class QueryBuilderTest { .selectAsterisk() .from(someBucket()) .where( - 12.toNumberType().isGreaterOrEqualThan(5.toNumberType()), + 12.toDopeType().isGreaterOrEqualThan(5.toDopeType()), ).build().queryString assertEquals(expected, actual) @@ -299,7 +297,7 @@ class QueryBuilderTest { .selectAsterisk() .from(someBucket()) .where( - someNumberField().isGreaterOrEqualThan(5.toNumberType()), + someNumberField().isGreaterOrEqualThan(5.toDopeType()), ).build().queryString assertEquals(expected, actual) @@ -313,7 +311,7 @@ class QueryBuilderTest { .selectAsterisk() .from(someBucket()) .where( - 3.toNumberType().isGreaterOrEqualThan(someNumberField()), + 3.toDopeType().isGreaterOrEqualThan(someNumberField()), ).build().queryString assertEquals(expected, actual) @@ -327,7 +325,7 @@ class QueryBuilderTest { .selectAsterisk() .from(someBucket()) .where( - "test".toStringType().isGreaterOrEqualThan("hallo".toStringType()), + "test".toDopeType().isGreaterOrEqualThan("hallo".toDopeType()), ).build().queryString assertEquals(expected, actual) @@ -341,7 +339,7 @@ class QueryBuilderTest { .selectAsterisk() .from(someBucket()) .where( - someStringField().isGreaterOrEqualThan("5".toStringType()), + someStringField().isGreaterOrEqualThan("5".toDopeType()), ).build().queryString assertEquals(expected, actual) @@ -355,7 +353,7 @@ class QueryBuilderTest { .selectAsterisk() .from(someBucket()) .where( - "test".toStringType().isGreaterOrEqualThan(someStringField()), + "test".toDopeType().isGreaterOrEqualThan(someStringField()), ).build().queryString assertEquals(expected, actual) @@ -369,7 +367,7 @@ class QueryBuilderTest { .selectAsterisk() .from(someBucket()) .where( - 12.toNumberType().isLessOrEqualThan(5.toNumberType()), + 12.toDopeType().isLessOrEqualThan(5.toDopeType()), ).build().queryString assertEquals(expected, actual) @@ -383,7 +381,7 @@ class QueryBuilderTest { .selectAsterisk() .from(someBucket()) .where( - someNumberField().isLessOrEqualThan(5.toNumberType()), + someNumberField().isLessOrEqualThan(5.toDopeType()), ).build().queryString assertEquals(expected, actual) @@ -397,7 +395,7 @@ class QueryBuilderTest { .selectAsterisk() .from(someBucket()) .where( - 3.toNumberType().isLessOrEqualThan(someNumberField()), + 3.toDopeType().isLessOrEqualThan(someNumberField()), ).build().queryString assertEquals(expected, actual) @@ -411,7 +409,7 @@ class QueryBuilderTest { .selectAsterisk() .from(someBucket()) .where( - "test".toStringType().isLessOrEqualThan("hallo".toStringType()), + "test".toDopeType().isLessOrEqualThan("hallo".toDopeType()), ).build().queryString assertEquals(expected, actual) @@ -425,7 +423,7 @@ class QueryBuilderTest { .selectAsterisk() .from(someBucket()) .where( - someStringField().isLessOrEqualThan("5".toStringType()), + someStringField().isLessOrEqualThan("5".toDopeType()), ).build().queryString assertEquals(expected, actual) @@ -441,12 +439,12 @@ class QueryBuilderTest { someBucket(), ).where( someNumberField().isLessThan( - (45 + 5).toNumberType(), + (45 + 5).toDopeType(), ).and( someStringField().isEqualTo( - "Mr.".toStringType(), + "Mr.".toDopeType(), ).and( - someStringField().isEqualTo("friend".toStringType()), + someStringField().isEqualTo("friend".toDopeType()), ), ), ).build().queryString @@ -464,7 +462,7 @@ class QueryBuilderTest { someBucket(), ).where( someStringField("email").isLike( - "%@yahoo.com".toStringType(), + "%@yahoo.com".toDopeType(), ), ).build().queryString @@ -482,9 +480,9 @@ class QueryBuilderTest { someBucket(), ).where( someStringField("email").isLike( - "%@gmail.com".toStringType(), + "%@gmail.com".toDopeType(), ).and( - someNumberField().isEqualTo(46.toNumberType()), + someNumberField().isEqualTo(46.toDopeType()), ), ).build().queryString @@ -518,25 +516,25 @@ class QueryBuilderTest { val expected = "SELECT ((1 = 1 AND 2 = 2) AND 3 = 3) AS `what` FROM `someBucket` WHERE (1 = 1 AND \"run\" = \"run\")" val actual: String = create.select( - 1.toNumberType().isEqualTo( - 1.toNumberType(), + 1.toDopeType().isEqualTo( + 1.toDopeType(), ).and( - 2.toNumberType().isEqualTo( - 2.toNumberType(), + 2.toDopeType().isEqualTo( + 2.toDopeType(), ), ).and( - 3.toNumberType().isEqualTo( - 3.toNumberType(), + 3.toDopeType().isEqualTo( + 3.toDopeType(), ), ).alias("what"), ).from( someBucket(), ).where( - 1.toNumberType().isEqualTo( - 1.toNumberType(), + 1.toDopeType().isEqualTo( + 1.toDopeType(), ).and( - "run".toStringType().isEqualTo( - "run".toStringType(), + "run".toDopeType().isEqualTo( + "run".toDopeType(), ), ), ).build().queryString @@ -566,7 +564,7 @@ class QueryBuilderTest { fun `should Support Simple String Value False`() { val expected = "SELECT \"FALSE\"" - val actual: String = create.select("FALSE".toStringType()).build().queryString + val actual: String = create.select("FALSE".toDopeType()).build().queryString assertEquals(unifyString(expected), actual) } @@ -758,7 +756,7 @@ class QueryBuilderTest { val getSomething = { "something" } val expected = "TRUE" - val actual = (getSomething() == "something").toBooleanType().toDopeQuery().queryString + val actual = (getSomething() == "something").toDopeType().toDopeQuery().queryString assertEquals(expected, actual) } diff --git a/core/src/test/kotlin/ch/ergon/dope/QueryStringBuilderTest.kt b/core/src/test/kotlin/ch/ergon/dope/QueryStringBuilderTest.kt index 9061aa2b..782dbdaa 100644 --- a/core/src/test/kotlin/ch/ergon/dope/QueryStringBuilderTest.kt +++ b/core/src/test/kotlin/ch/ergon/dope/QueryStringBuilderTest.kt @@ -1,7 +1,6 @@ package ch.ergon.dope -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.formatPathToQueryString import ch.ergon.dope.resolvable.formatToQueryString import ch.ergon.dope.resolvable.formatToQueryStringWithBrackets @@ -36,7 +35,7 @@ class QueryStringBuilderTest { @Test fun `should format symbol with arguments`() { val symbol = "testsymbol" - val arguments = arrayOf(1.toNumberType(), "hallo".toStringType()) + val arguments = arrayOf(1.toDopeType(), "hallo".toDopeType()) val expected = "$symbol ${arguments.joinToString(", ") { it.toDopeQuery().queryString }}" val actual = formatToQueryString(symbol, *arguments.map { it.toDopeQuery().queryString }.toTypedArray()) @@ -59,7 +58,7 @@ class QueryStringBuilderTest { @Test fun `should format symbol with arguments and brackets`() { val symbol = "testsymbol" - val arguments = arrayOf(1.toNumberType(), "hallo".toStringType()) + val arguments = arrayOf(1.toDopeType(), "hallo".toDopeType()) val expected = "$symbol(${arguments.joinToString(", ") { it.toDopeQuery().queryString }})" val actual = formatToQueryStringWithBrackets(symbol, *arguments.map { it.toDopeQuery().queryString }.toTypedArray()) diff --git a/core/src/test/kotlin/ch/ergon/dope/StringFunctionsTest.kt b/core/src/test/kotlin/ch/ergon/dope/StringFunctionsTest.kt index 46de55bf..e78fac00 100644 --- a/core/src/test/kotlin/ch/ergon/dope/StringFunctionsTest.kt +++ b/core/src/test/kotlin/ch/ergon/dope/StringFunctionsTest.kt @@ -28,8 +28,7 @@ import ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction.suffixe import ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction.title import ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction.trim import ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction.upper -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import kotlin.test.BeforeTest import kotlin.test.Test import kotlin.test.assertEquals @@ -50,7 +49,7 @@ class StringFunctionsTest { val expected = "SELECT CONCAT(\"abc\", \"def\", \"ghi\") AS `concat`" val actual: String = create.select( - concat("abc".toStringType(), "def".toStringType(), "ghi".toStringType()).alias("concat"), + concat("abc".toDopeType(), "def".toDopeType(), "ghi".toDopeType()).alias("concat"), ).build().queryString assertEquals(unifyString(expected), actual) @@ -73,9 +72,9 @@ class StringFunctionsTest { val actual: String = create.select( concat( - "abc".toStringType(), - "def".toStringType(), - "ghi".toStringType(), + "abc".toDopeType(), + "def".toDopeType(), + "ghi".toDopeType(), someStringField(), ).alias( "concat", @@ -92,10 +91,10 @@ class StringFunctionsTest { val actual: String = create.select( concat2( "-", - "a".toStringType(), - "b".toStringType(), - "c".toStringType(), - "d".toStringType(), + "a".toDopeType(), + "b".toDopeType(), + "c".toDopeType(), + "d".toDopeType(), ).alias("c1"), ).build().queryString @@ -125,7 +124,7 @@ class StringFunctionsTest { val actual: String = create.select( concat2( - "-".toStringType(), + "-".toDopeType(), "a", "b", "c", @@ -140,7 +139,7 @@ class StringFunctionsTest { fun `should Support Concat2 One Argument`() { val expected = "CONCAT2(\"-\", \"a\") AS `c2`" - val actual: String = concat2("-", "a".toStringType()).alias("c2").toDopeQuery().queryString + val actual: String = concat2("-", "a".toDopeType()).alias("c2").toDopeQuery().queryString assertEquals(unifyString(expected), actual) } @@ -150,7 +149,7 @@ class StringFunctionsTest { val expected = "SELECT CONTAINS(\"N1QL is awesome\", \"N1QL\") AS `n1ql`\n" val actual: String = create.select( - contains("N1QL is awesome".toStringType(), "N1QL".toStringType()) + contains("N1QL is awesome".toDopeType(), "N1QL".toDopeType()) .alias("n1ql"), ).build().queryString @@ -162,7 +161,7 @@ class StringFunctionsTest { val expected = "SELECT CONTAINS(\"N1QL is awesome\", \"N1QL\") AS `n1ql`\n" val actual: String = create.select( - contains("N1QL is awesome", "N1QL".toStringType()) + contains("N1QL is awesome", "N1QL".toDopeType()) .alias("n1ql"), ).build().queryString @@ -176,7 +175,7 @@ class StringFunctionsTest { val actual: String = create.select( - contains("N1QL is awesome".toStringType(), "N1QL".toStringType()).alias("n1ql"), + contains("N1QL is awesome".toDopeType(), "N1QL".toDopeType()).alias("n1ql"), contains("N1QL is awesome", "SQL").alias("no_sql"), ).build().queryString @@ -245,13 +244,13 @@ class StringFunctionsTest { " LPAD(\"N1QL is awesome\", 4, \"987654321\") AS `truncate_string`" val actual: String = create.select( - lpad("N1QL is awesome".toStringType(), 20).alias("implicit_padding"), - lpad("N1QL is awesome".toStringType(), 20, "-*").alias("repeated_padding"), - lpad("N1QL is awesome".toStringType(), 20.toNumberType(), "987654321").alias("truncate_padding"), - lpad("N1QL is awesome", 20.toNumberType()), - lpad("N1QL is awesome", 20.toNumberType(), "987654321".toStringType()), - lpad("N1QL is awesome", 20.toNumberType(), "987654321"), - lpad("N1QL is awesome".toStringType(), 4, "987654321".toStringType()).alias("truncate_string"), + lpad("N1QL is awesome".toDopeType(), 20).alias("implicit_padding"), + lpad("N1QL is awesome".toDopeType(), 20, "-*").alias("repeated_padding"), + lpad("N1QL is awesome".toDopeType(), 20.toDopeType(), "987654321").alias("truncate_padding"), + lpad("N1QL is awesome", 20.toDopeType()), + lpad("N1QL is awesome", 20.toDopeType(), "987654321".toDopeType()), + lpad("N1QL is awesome", 20.toDopeType(), "987654321"), + lpad("N1QL is awesome".toDopeType(), 4, "987654321".toDopeType()).alias("truncate_string"), ).build().queryString assertEquals(unifyString(expected), actual) @@ -262,7 +261,7 @@ class StringFunctionsTest { val expected = "SELECT LPAD(\"N1QL is awesome\", 20, \"1234\") AS `implicit_padding`" val actual: String = create.select( - lpad("N1QL is awesome", 20, "1234".toStringType()).alias("implicit_padding"), + lpad("N1QL is awesome", 20, "1234".toDopeType()).alias("implicit_padding"), ).build().queryString assertEquals(unifyString(expected), actual) @@ -277,7 +276,7 @@ class StringFunctionsTest { ltrim("...N1QL is awesome", ".").alias("dots"), ltrim(" N1QL is awesome", " ").alias("explicit_spaces"), ltrim(" N1QL is awesome").alias("implicit_spaces"), - ltrim("N1QL is awesome".toStringType()).alias("no_dots"), + ltrim("N1QL is awesome".toDopeType()).alias("no_dots"), ).build().queryString assertEquals(expected, actual) @@ -299,8 +298,8 @@ class StringFunctionsTest { val expected = "SELECT LTRIM(\"...N1QL is awesome\", \".\") AS `dots`, LTRIM(\"...N1QL is awesome\", \".\")" val actual: String = create.select( - ltrim("...N1QL is awesome".toStringType(), ".").alias("dots"), - ltrim("...N1QL is awesome", ".".toStringType()), + ltrim("...N1QL is awesome".toDopeType(), ".").alias("dots"), + ltrim("...N1QL is awesome", ".".toDopeType()), ).build().queryString assertEquals(expected, actual) @@ -328,9 +327,9 @@ class StringFunctionsTest { " MASK(\"SomeTextToMask\", {\"mask\": \"++++ ++++\"}) AS `mask_hole`" val actual: String = create.select( - mask("SomeTextToMask".toStringType()).alias("mask"), - mask("SomeTextToMask".toStringType(), mapOf("mask" to "++++")).alias("mask_custom"), - mask("SomeTextToMask".toStringType(), mapOf("mask" to "++++ ++++")).alias("mask_hole"), + mask("SomeTextToMask".toDopeType()).alias("mask"), + mask("SomeTextToMask".toDopeType(), mapOf("mask" to "++++")).alias("mask_custom"), + mask("SomeTextToMask".toDopeType(), mapOf("mask" to "++++ ++++")).alias("mask_hole"), ).build().queryString assertEquals(unifyString(expected), actual) @@ -376,9 +375,9 @@ class StringFunctionsTest { " POSITION(\"N1QL is awesome\", \"SQL\") AS `sql`" val actual: String = create.select( - position("N1QL is awesome".toStringType(), "awesome").alias("awesome"), - position("N1QL is awesome".toStringType(), "N1QL").alias("n1ql"), - position("N1QL is awesome".toStringType(), "SQL").alias("sql"), + position("N1QL is awesome".toDopeType(), "awesome").alias("awesome"), + position("N1QL is awesome".toDopeType(), "N1QL").alias("n1ql"), + position("N1QL is awesome".toDopeType(), "SQL").alias("sql"), ).build().queryString assertEquals(unifyString(expected), actual) @@ -391,9 +390,9 @@ class StringFunctionsTest { " POSITION(\"N1QL is awesome\", \"SQL\") AS `sql`" val actual: String = create.select( - position("N1QL is awesome", "awesome".toStringType()).alias("awesome"), - position("N1QL is awesome", "N1QL".toStringType()).alias("n1ql"), - position("N1QL is awesome", "SQL".toStringType()).alias("sql"), + position("N1QL is awesome", "awesome".toDopeType()).alias("awesome"), + position("N1QL is awesome", "N1QL".toDopeType()).alias("n1ql"), + position("N1QL is awesome", "SQL".toDopeType()).alias("sql"), ).build().queryString assertEquals(unifyString(expected), actual) @@ -405,9 +404,9 @@ class StringFunctionsTest { val actual: String = create.select( repeat("N1QL", 0).alias("empty_string"), - repeat("N1QL".toStringType(), 3), - repeat("N1QL".toStringType(), 3.toNumberType()), - repeat("N1QL", 3.toNumberType()).alias("n1ql_3"), + repeat("N1QL".toDopeType(), 3), + repeat("N1QL".toDopeType(), 3.toDopeType()), + repeat("N1QL", 3.toDopeType()).alias("n1ql_3"), ).build().queryString assertEquals(unifyString(expected), actual) @@ -441,9 +440,9 @@ class StringFunctionsTest { rpad("N1QL is awesome", 20, "-*").alias("repeated_padding"), rpad("N1QL is awesome", 20, "123456789").alias("truncate_padding"), rpad("N1QL is awesome", 4, "123456789").alias("truncate_string"), - rpad("N1QL is awesome", 4.toNumberType(), "123456789".toStringType()).alias("truncate_string"), - rpad("N1QL is awesome", 4.toNumberType()).alias("truncate_string"), - rpad("N1QL is awesome".toStringType(), 4, "123456789".toStringType()).alias("truncate_string"), + rpad("N1QL is awesome", 4.toDopeType(), "123456789".toDopeType()).alias("truncate_string"), + rpad("N1QL is awesome", 4.toDopeType()).alias("truncate_string"), + rpad("N1QL is awesome".toDopeType(), 4, "123456789".toDopeType()).alias("truncate_string"), ).build().queryString assertEquals(unifyString(expected), actual) @@ -457,10 +456,10 @@ class StringFunctionsTest { " RPAD(\"N1QL is awesome\", 4, \"123456789\") AS `truncate_string`" val actual: String = create.select( - rpad("N1QL is awesome".toStringType(), 20).alias("implicit_padding"), - rpad("N1QL is awesome".toStringType(), 20, "-*").alias("repeated_padding"), - rpad("N1QL is awesome".toStringType(), 20, "123456789").alias("truncate_padding"), - rpad("N1QL is awesome".toStringType(), 4, "123456789").alias("truncate_string"), + rpad("N1QL is awesome".toDopeType(), 20).alias("implicit_padding"), + rpad("N1QL is awesome".toDopeType(), 20, "-*").alias("repeated_padding"), + rpad("N1QL is awesome".toDopeType(), 20, "123456789").alias("truncate_padding"), + rpad("N1QL is awesome".toDopeType(), 4, "123456789").alias("truncate_string"), ).build().queryString assertEquals(unifyString(expected), actual) @@ -475,9 +474,9 @@ class StringFunctionsTest { val actual: String = create.select( rpad("N1QL is awesome", 20).alias("implicit_padding"), - rpad("N1QL is awesome", 20, "-*".toStringType()).alias("repeated_padding"), - rpad("N1QL is awesome", 20, "123456789".toStringType()).alias("truncate_padding"), - rpad("N1QL is awesome", 4, "123456789".toStringType()).alias("truncate_string"), + rpad("N1QL is awesome", 20, "-*".toDopeType()).alias("repeated_padding"), + rpad("N1QL is awesome", 20, "123456789".toDopeType()).alias("truncate_padding"), + rpad("N1QL is awesome", 4, "123456789".toDopeType()).alias("truncate_string"), ).build().queryString assertEquals(unifyString(expected), actual) @@ -522,10 +521,10 @@ class StringFunctionsTest { "`explicit_spaces`, RTRIM(\"N1QL is awesome \") AS `implicit_spaces`, RTRIM(\"N1QL is awesome\") AS `no_dots`" val actual: String = create.select( - rtrim("N1QL is awesome...".toStringType()).alias("dots"), - rtrim("N1QL is awesome ".toStringType()).alias("explicit_spaces"), - rtrim("N1QL is awesome ".toStringType()).alias("implicit_spaces"), - rtrim("N1QL is awesome".toStringType()).alias("no_dots"), + rtrim("N1QL is awesome...".toDopeType()).alias("dots"), + rtrim("N1QL is awesome ".toDopeType()).alias("explicit_spaces"), + rtrim("N1QL is awesome ".toDopeType()).alias("implicit_spaces"), + rtrim("N1QL is awesome".toDopeType()).alias("no_dots"), ).build().queryString assertEquals(expected, actual) @@ -538,10 +537,10 @@ class StringFunctionsTest { "`explicit_spaces`, RTRIM(\"N1QL is awesome \") AS `implicit_spaces`, RTRIM(\"N1QL is awesome\") AS `no_dots`" val actual: String = create.select( - rtrim("N1QL is awesome...".toStringType(), '.').alias("dots"), - rtrim("N1QL is awesome ".toStringType()).alias("explicit_spaces"), - rtrim("N1QL is awesome ".toStringType()).alias("implicit_spaces"), - rtrim("N1QL is awesome".toStringType()).alias("no_dots"), + rtrim("N1QL is awesome...".toDopeType(), '.').alias("dots"), + rtrim("N1QL is awesome ".toDopeType()).alias("explicit_spaces"), + rtrim("N1QL is awesome ".toDopeType()).alias("implicit_spaces"), + rtrim("N1QL is awesome".toDopeType()).alias("no_dots"), ).build().queryString assertEquals(expected, actual) @@ -569,9 +568,9 @@ class StringFunctionsTest { " `implicit_spaces`, SPLIT(\"N1QL is awesome\", \"is\") AS `split_is`" val actual: String = create.select( - split("N1QL is awesome".toStringType(), " ").alias("explicit_spaces"), - split("N1QL is awesome".toStringType()).alias("implicit_spaces"), - split("N1QL is awesome".toStringType(), "is").alias("split_is"), + split("N1QL is awesome".toDopeType(), " ").alias("explicit_spaces"), + split("N1QL is awesome".toDopeType()).alias("implicit_spaces"), + split("N1QL is awesome".toDopeType(), "is").alias("split_is"), ).build().queryString assertEquals(expected, actual) @@ -584,9 +583,9 @@ class StringFunctionsTest { " `implicit_spaces`, SPLIT(\"N1QL is awesome\", \"is\") AS `split_is`" val actual: String = create.select( - split("N1QL is awesome", " ".toStringType()).alias("explicit_spaces"), + split("N1QL is awesome", " ".toDopeType()).alias("explicit_spaces"), split("N1QL is awesome").alias("implicit_spaces"), - split("N1QL is awesome", "is".toStringType()).alias("split_is"), + split("N1QL is awesome", "is".toDopeType()).alias("split_is"), ).build().queryString assertEquals(expected, actual) @@ -629,7 +628,7 @@ class StringFunctionsTest { fun `should Support Title with string Type`() { val expected = "SELECT INITCAP(\"N1QL is awesome\") AS `n1ql`" - val actual: String = create.select(title("N1QL is awesome".toStringType()).alias("n1ql")).build().queryString + val actual: String = create.select(title("N1QL is awesome".toDopeType()).alias("n1ql")).build().queryString assertEquals(expected, actual) } @@ -741,13 +740,13 @@ class StringFunctionsTest { " TRIM(\"N1QL is awesome\") AS `no_dots`" val actual: String = create.select( - trim("...N1QL is awesome...".toStringType(), '.') + trim("...N1QL is awesome...".toDopeType(), '.') .alias("dots"), - trim(" N1QL is awesome ".toStringType()) + trim(" N1QL is awesome ".toDopeType()) .alias("explicit_spaces"), - trim(" N1QL is awesome ".toStringType()) + trim(" N1QL is awesome ".toDopeType()) .alias("implicit_spaces"), - trim("N1QL is awesome".toStringType()) + trim("N1QL is awesome".toDopeType()) .alias("no_dots"), ).build().queryString @@ -776,7 +775,7 @@ class StringFunctionsTest { fun `should support string functions with conditions in where clause`() { val expected = "SELECT * FROM `someBucket` WHERE UPPER(`stringField`) = \"VENDOLIN\"" val actual: String = - create.selectFrom(someBucket()).where(upper(someStringField()).isEqualTo("VENDOLIN".toStringType())).build().queryString + create.selectFrom(someBucket()).where(upper(someStringField()).isEqualTo("VENDOLIN".toDopeType())).build().queryString assertEquals(expected, actual) } diff --git a/core/src/test/kotlin/ch/ergon/dope/UnnestClauseTest.kt b/core/src/test/kotlin/ch/ergon/dope/UnnestClauseTest.kt index 5a5165f0..5618cb3d 100644 --- a/core/src/test/kotlin/ch/ergon/dope/UnnestClauseTest.kt +++ b/core/src/test/kotlin/ch/ergon/dope/UnnestClauseTest.kt @@ -11,8 +11,7 @@ import ch.ergon.dope.resolvable.expression.unaliased.type.asParameter import ch.ergon.dope.resolvable.expression.unaliased.type.logical.and import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isEqualTo import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isValued -import ch.ergon.dope.resolvable.expression.unaliased.type.toArrayType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import ch.ergon.dope.resolvable.fromable.asterisk import ch.ergon.dope.validtype.ArrayType import ch.ergon.dope.validtype.StringType @@ -31,7 +30,7 @@ class UnnestClauseTest { @Test fun `should support unnest`() { val airline = someBucket() - val aField = listOf("a".toStringType()).toArrayType() + val aField = listOf("a".toDopeType()).toDopeType() val expected = "SELECT * FROM `someBucket` UNNEST [\"a\"] AS `a`" val alias: AliasedExpression> = aField.alias("a") diff --git a/core/src/test/kotlin/ch/ergon/dope/UseClauseTest.kt b/core/src/test/kotlin/ch/ergon/dope/UseClauseTest.kt index 81cbd8a3..915e56ae 100644 --- a/core/src/test/kotlin/ch/ergon/dope/UseClauseTest.kt +++ b/core/src/test/kotlin/ch/ergon/dope/UseClauseTest.kt @@ -6,8 +6,7 @@ import ch.ergon.dope.helper.someStringArrayField import ch.ergon.dope.helper.someStringField import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isEqualTo import ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction.concat -import ch.ergon.dope.resolvable.expression.unaliased.type.toArrayType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType import junit.framework.TestCase.assertEquals import kotlin.test.BeforeTest import kotlin.test.Test @@ -30,7 +29,7 @@ class UseClauseTest { someBucket(), ) .useKeys( - "someId".toStringType(), + "someId".toDopeType(), ) .build().queryString @@ -64,7 +63,7 @@ class UseClauseTest { someBucket(), ) .useKeys( - listOf("someId".toStringType(), "anotherId".toStringType()).toArrayType(), + listOf("someId".toDopeType(), "anotherId".toDopeType()).toDopeType(), ).build().queryString assertEquals(expected, actual) @@ -96,7 +95,7 @@ class UseClauseTest { someBucket(), ) .useKeys( - "someId".toStringType(), + "someId".toDopeType(), ) .where( someNumberField().isEqualTo(1), @@ -131,7 +130,7 @@ class UseClauseTest { someBucket(), ) .useKeys( - "someId".toStringType(), + "someId".toDopeType(), ) .build().queryString @@ -163,7 +162,7 @@ class UseClauseTest { someBucket(), ) .useKeys( - listOf("someId".toStringType(), "anotherId".toStringType()).toArrayType(), + listOf("someId".toDopeType(), "anotherId".toDopeType()).toDopeType(), ).build().queryString assertEquals(expected, actual) @@ -193,7 +192,7 @@ class UseClauseTest { someBucket(), ) .useKeys( - "someId".toStringType(), + "someId".toDopeType(), ) .where( someNumberField().isEqualTo(1), diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/CrystalMapAdapter.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/CrystalMapAdapter.kt index 593d670e..ecfd6a4e 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/CrystalMapAdapter.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/CrystalMapAdapter.kt @@ -15,7 +15,7 @@ import com.schwarz.crystalapi.schema.CMObjectList import com.schwarz.crystalapi.schema.CMType import com.schwarz.crystalapi.schema.Schema -fun CMType.asField(reference: String = path): Field = Field( +fun CMType.toDopeType(reference: String = path): Field = Field( when (this) { is CMField<*> -> this.name is CMList<*> -> this.name @@ -26,25 +26,25 @@ fun CMType.asField(reference: String = path): Field = Field( reference, ) -@JvmName("asNumberField") -fun CMField.asField(reference: String = path): Field = Field(name, reference) +@JvmName("toDopeNumberField") +fun CMField.toDopeType(reference: String = path): Field = Field(name, reference) -@JvmName("asStringField") -fun CMField.asField(reference: String = path): Field = Field(name, reference) +@JvmName("toDopeStringField") +fun CMField.toDopeType(reference: String = path): Field = Field(name, reference) -@JvmName("asBooleanField") -fun CMField.asField(reference: String = path): Field = Field(name, reference) +@JvmName("toDopeBooleanField") +fun CMField.toDopeType(reference: String = path): Field = Field(name, reference) -@JvmName("asNumberArrayField") -fun CMList.asArrayField(): Field> = Field(name, path) +@JvmName("toDopeNumberArrayField") +fun CMList.toDopeType(): Field> = Field(name, path) -@JvmName("asStringArrayField") -fun CMList.asArrayField(): Field> = Field(name, path) +@JvmName("toDopeStringArrayField") +fun CMList.toDopeType(): Field> = Field(name, path) -@JvmName("asBooleanArrayField") -fun CMList.asArrayField(): Field> = Field(name, path) +@JvmName("toDopeBooleanArrayField") +fun CMList.toDopeType(): Field> = Field(name, path) -fun CMList.asArrayField(): Field> = Field(name, path) +fun CMList.toDopeType(): Field> = Field(name, path) // TODO: DOPE-192 -fun CMObjectList.asSchemaArray() = DopeSchemaArray(element, formatPathToQueryString(name, path)) +fun CMObjectList.toDopeType() = DopeSchemaArray(element, formatPathToQueryString(name, path)) diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/QueryBuilder.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/QueryBuilder.kt index b3356fb4..3195e637 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/QueryBuilder.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/QueryBuilder.kt @@ -1,16 +1,16 @@ package ch.ergon.dope.extension import ch.ergon.dope.QueryBuilder -import ch.ergon.dope.asField import ch.ergon.dope.resolvable.clause.model.SelectClause import ch.ergon.dope.resolvable.clause.model.SelectDistinctClause import ch.ergon.dope.resolvable.clause.model.SelectRawClause +import ch.ergon.dope.toDopeType import com.schwarz.crystalapi.schema.CMType fun QueryBuilder.select(expression: CMType, vararg expressions: CMType): SelectClause = - select(expression.asField(), *expressions.map { it.asField() }.toTypedArray()) + select(expression.toDopeType(), *expressions.map { it.toDopeType() }.toTypedArray()) fun QueryBuilder.selectDistinct(expression: CMType, vararg expressions: CMType): SelectDistinctClause = - selectDistinct(expression.asField(), *expressions.map { it.asField() }.toTypedArray()) + selectDistinct(expression.toDopeType(), *expressions.map { it.toDopeType() }.toTypedArray()) -fun QueryBuilder.selectRaw(expression: CMType): SelectRawClause = selectRaw(expression.asField()) +fun QueryBuilder.selectRaw(expression: CMType): SelectRawClause = selectRaw(expression.toDopeType()) diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/aggregator/ArrayAggregate.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/aggregator/ArrayAggregate.kt index 93fc28be..4fe8ed3e 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/aggregator/ArrayAggregate.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/aggregator/ArrayAggregate.kt @@ -1,34 +1,33 @@ package ch.ergon.dope.extension.aggregator -import ch.ergon.dope.asArrayField -import ch.ergon.dope.asField import ch.ergon.dope.resolvable.expression.unaliased.aggregator.AggregateQuantifier import ch.ergon.dope.resolvable.expression.unaliased.aggregator.ArrayAggregateExpression import ch.ergon.dope.resolvable.expression.unaliased.aggregator.arrayAggregate +import ch.ergon.dope.toDopeType import ch.ergon.dope.validtype.ValidType import com.schwarz.crystalapi.schema.CMField import com.schwarz.crystalapi.schema.CMList @JvmName("arrayAggNumber") fun arrayAggregate(field: CMField, quantifier: AggregateQuantifier? = null): - ArrayAggregateExpression = arrayAggregate(field.asField(), quantifier) + ArrayAggregateExpression = arrayAggregate(field.toDopeType(), quantifier) @JvmName("arrayAggString") fun arrayAggregate(field: CMField, quantifier: AggregateQuantifier? = null): - ArrayAggregateExpression = arrayAggregate(field.asField(), quantifier) + ArrayAggregateExpression = arrayAggregate(field.toDopeType(), quantifier) @JvmName("arrayAggBoolean") fun arrayAggregate(field: CMField, quantifier: AggregateQuantifier? = null): - ArrayAggregateExpression = arrayAggregate(field.asField(), quantifier) + ArrayAggregateExpression = arrayAggregate(field.toDopeType(), quantifier) @JvmName("arrayAggNumberArray") fun arrayAggregate(field: CMList, quantifier: AggregateQuantifier? = null): - ArrayAggregateExpression = arrayAggregate(field.asArrayField(), quantifier) + ArrayAggregateExpression = arrayAggregate(field.toDopeType(), quantifier) @JvmName("arrayAggStringArray") fun arrayAggregate(field: CMList, quantifier: AggregateQuantifier? = null): - ArrayAggregateExpression = arrayAggregate(field.asArrayField(), quantifier) + ArrayAggregateExpression = arrayAggregate(field.toDopeType(), quantifier) @JvmName("arrayAggBooleanArray") fun arrayAggregate(field: CMList, quantifier: AggregateQuantifier? = null): - ArrayAggregateExpression = arrayAggregate(field.asArrayField(), quantifier) + ArrayAggregateExpression = arrayAggregate(field.toDopeType(), quantifier) diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/aggregator/Count.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/aggregator/Count.kt index cf141368..a85b2818 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/aggregator/Count.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/aggregator/Count.kt @@ -1,33 +1,32 @@ package ch.ergon.dope.extension.aggregator -import ch.ergon.dope.asArrayField -import ch.ergon.dope.asField import ch.ergon.dope.resolvable.expression.unaliased.aggregator.AggregateQuantifier import ch.ergon.dope.resolvable.expression.unaliased.aggregator.CountExpression import ch.ergon.dope.resolvable.expression.unaliased.aggregator.count +import ch.ergon.dope.toDopeType import com.schwarz.crystalapi.schema.CMField import com.schwarz.crystalapi.schema.CMList @JvmName("countNumber") fun count(field: CMField, quantifier: AggregateQuantifier? = null): - CountExpression = count(field.asField(), quantifier) + CountExpression = count(field.toDopeType(), quantifier) @JvmName("countString") fun count(field: CMField, quantifier: AggregateQuantifier? = null): - CountExpression = count(field.asField(), quantifier) + CountExpression = count(field.toDopeType(), quantifier) @JvmName("countBoolean") fun count(field: CMField, quantifier: AggregateQuantifier? = null): - CountExpression = count(field.asField(), quantifier) + CountExpression = count(field.toDopeType(), quantifier) @JvmName("countNumber") fun count(field: CMList, quantifier: AggregateQuantifier? = null): - CountExpression = count(field.asArrayField(), quantifier) + CountExpression = count(field.toDopeType(), quantifier) @JvmName("countString") fun count(field: CMList, quantifier: AggregateQuantifier? = null): - CountExpression = count(field.asArrayField(), quantifier) + CountExpression = count(field.toDopeType(), quantifier) @JvmName("countBoolean") fun count(field: CMList, quantifier: AggregateQuantifier? = null): - CountExpression = count(field.asArrayField(), quantifier) + CountExpression = count(field.toDopeType(), quantifier) diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/aggregator/Max.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/aggregator/Max.kt index 7103c3ed..2e66efe3 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/aggregator/Max.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/aggregator/Max.kt @@ -1,34 +1,33 @@ package ch.ergon.dope.extension.aggregator -import ch.ergon.dope.asArrayField -import ch.ergon.dope.asField import ch.ergon.dope.resolvable.expression.unaliased.aggregator.AggregateQuantifier import ch.ergon.dope.resolvable.expression.unaliased.aggregator.MaxExpression import ch.ergon.dope.resolvable.expression.unaliased.aggregator.max +import ch.ergon.dope.toDopeType import ch.ergon.dope.validtype.ValidType import com.schwarz.crystalapi.schema.CMField import com.schwarz.crystalapi.schema.CMList @JvmName("maxNumber") fun max(field: CMField, quantifier: AggregateQuantifier? = null): - MaxExpression = max(field.asField(), quantifier) + MaxExpression = max(field.toDopeType(), quantifier) @JvmName("maxString") fun max(field: CMField, quantifier: AggregateQuantifier? = null): - MaxExpression = max(field.asField(), quantifier) + MaxExpression = max(field.toDopeType(), quantifier) @JvmName("maxBoolean") fun max(field: CMField, quantifier: AggregateQuantifier? = null): - MaxExpression = max(field.asField(), quantifier) + MaxExpression = max(field.toDopeType(), quantifier) @JvmName("maxNumber") fun max(field: CMList, quantifier: AggregateQuantifier? = null): - MaxExpression = max(field.asArrayField(), quantifier) + MaxExpression = max(field.toDopeType(), quantifier) @JvmName("maxString") fun max(field: CMList, quantifier: AggregateQuantifier? = null): - MaxExpression = max(field.asArrayField(), quantifier) + MaxExpression = max(field.toDopeType(), quantifier) @JvmName("maxBoolean") fun max(field: CMList, quantifier: AggregateQuantifier? = null): - MaxExpression = max(field.asArrayField(), quantifier) + MaxExpression = max(field.toDopeType(), quantifier) diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/aggregator/Min.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/aggregator/Min.kt index fb4cdb4b..24122292 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/aggregator/Min.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/aggregator/Min.kt @@ -1,34 +1,33 @@ package ch.ergon.dope.extension.aggregator -import ch.ergon.dope.asArrayField -import ch.ergon.dope.asField import ch.ergon.dope.resolvable.expression.unaliased.aggregator.AggregateQuantifier import ch.ergon.dope.resolvable.expression.unaliased.aggregator.MinExpression import ch.ergon.dope.resolvable.expression.unaliased.aggregator.min +import ch.ergon.dope.toDopeType import ch.ergon.dope.validtype.ValidType import com.schwarz.crystalapi.schema.CMField import com.schwarz.crystalapi.schema.CMList @JvmName("minNumber") fun min(field: CMField, quantifier: AggregateQuantifier? = null): - MinExpression = min(field.asField(), quantifier) + MinExpression = min(field.toDopeType(), quantifier) @JvmName("minString") fun min(field: CMField, quantifier: AggregateQuantifier? = null): - MinExpression = min(field.asField(), quantifier) + MinExpression = min(field.toDopeType(), quantifier) @JvmName("minBoolean") fun min(field: CMField, quantifier: AggregateQuantifier? = null): - MinExpression = min(field.asField(), quantifier) + MinExpression = min(field.toDopeType(), quantifier) @JvmName("minNumber") fun min(field: CMList, quantifier: AggregateQuantifier? = null): - MinExpression = min(field.asArrayField(), quantifier) + MinExpression = min(field.toDopeType(), quantifier) @JvmName("minString") fun min(field: CMList, quantifier: AggregateQuantifier? = null): - MinExpression = min(field.asArrayField(), quantifier) + MinExpression = min(field.toDopeType(), quantifier) @JvmName("minBoolean") fun min(field: CMList, quantifier: AggregateQuantifier? = null): - MinExpression = min(field.asArrayField(), quantifier) + MinExpression = min(field.toDopeType(), quantifier) diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/aggregator/NumberAggregate.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/aggregator/NumberAggregate.kt index 42082ec4..da57b697 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/aggregator/NumberAggregate.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/aggregator/NumberAggregate.kt @@ -1,6 +1,5 @@ package ch.ergon.dope.extension.aggregator -import ch.ergon.dope.asField import ch.ergon.dope.resolvable.expression.unaliased.aggregator.AggregateQuantifier import ch.ergon.dope.resolvable.expression.unaliased.aggregator.AverageExpression import ch.ergon.dope.resolvable.expression.unaliased.aggregator.MeanExpression @@ -14,29 +13,30 @@ import ch.ergon.dope.resolvable.expression.unaliased.aggregator.median import ch.ergon.dope.resolvable.expression.unaliased.aggregator.stdDev import ch.ergon.dope.resolvable.expression.unaliased.aggregator.sum import ch.ergon.dope.resolvable.expression.unaliased.aggregator.variance +import ch.ergon.dope.toDopeType import ch.ergon.dope.validtype.NumberType import com.schwarz.crystalapi.schema.CMField @JvmName("avgNumber") fun avg(field: CMField, quantifier: AggregateQuantifier? = null): - AverageExpression = avg(field.asField(), quantifier) + AverageExpression = avg(field.toDopeType(), quantifier) @JvmName("meanNumber") fun mean(field: CMField, quantifier: AggregateQuantifier? = null): - MeanExpression = mean(field.asField(), quantifier) + MeanExpression = mean(field.toDopeType(), quantifier) @JvmName("medianNumber") fun median(field: CMField, quantifier: AggregateQuantifier? = null): - MedianExpression = median(field.asField(), quantifier) + MedianExpression = median(field.toDopeType(), quantifier) @JvmName("sumNumber") fun sum(field: CMField, quantifier: AggregateQuantifier? = null): - SumExpression = sum(field.asField(), quantifier) + SumExpression = sum(field.toDopeType(), quantifier) @JvmName("stdDevNumber") fun stdDev(field: CMField, quantifier: AggregateQuantifier? = null): - StandardDeviationExpression = stdDev(field.asField(), quantifier) + StandardDeviationExpression = stdDev(field.toDopeType(), quantifier) @JvmName("varianceNumber") fun variance(field: CMField, quantifier: AggregateQuantifier? = null): - VarianceExpression = variance(field.asField(), quantifier) + VarianceExpression = variance(field.toDopeType(), quantifier) diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/clause/DeleteClause.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/clause/DeleteClause.kt index e51049b3..ad0d3d3e 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/clause/DeleteClause.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/clause/DeleteClause.kt @@ -1,18 +1,18 @@ package ch.ergon.dope.extension.clause -import ch.ergon.dope.asField import ch.ergon.dope.resolvable.clause.IDeleteClause import ch.ergon.dope.resolvable.clause.IDeleteLimitClause import ch.ergon.dope.resolvable.clause.IDeleteOffsetClause import ch.ergon.dope.resolvable.clause.IDeleteWhereClause +import ch.ergon.dope.toDopeType import com.schwarz.crystalapi.schema.CMField import com.schwarz.crystalapi.schema.CMType fun IDeleteOffsetClause.returning(field: CMType, vararg fields: CMType) = - returning(field.asField(), *fields.map { it.asField() }.toTypedArray()) + returning(field.toDopeType(), *fields.map { it.toDopeType() }.toTypedArray()) -fun IDeleteLimitClause.offset(numberExpression: CMField) = offset(numberExpression.asField()) +fun IDeleteLimitClause.offset(numberExpression: CMField) = offset(numberExpression.toDopeType()) -fun IDeleteWhereClause.limit(numberExpression: CMField) = limit(numberExpression.asField()) +fun IDeleteWhereClause.limit(numberExpression: CMField) = limit(numberExpression.toDopeType()) -fun IDeleteClause.where(booleanExpression: CMField) = where(booleanExpression.asField()) +fun IDeleteClause.where(booleanExpression: CMField) = where(booleanExpression.toDopeType()) diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/clause/SelectClause.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/clause/SelectClause.kt index 439f9da5..9c4e88af 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/clause/SelectClause.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/clause/SelectClause.kt @@ -1,7 +1,5 @@ package ch.ergon.dope.extension.clause -import ch.ergon.dope.asArrayField -import ch.ergon.dope.asField import ch.ergon.dope.resolvable.clause.ISelectFromClause import ch.ergon.dope.resolvable.clause.ISelectGroupByClause import ch.ergon.dope.resolvable.clause.ISelectJoinClause @@ -15,38 +13,39 @@ import ch.ergon.dope.resolvable.clause.model.SelectLimitClause import ch.ergon.dope.resolvable.clause.model.SelectOffsetClause import ch.ergon.dope.resolvable.clause.model.SelectOrderByClause import ch.ergon.dope.resolvable.fromable.Bucket +import ch.ergon.dope.toDopeType import com.schwarz.crystalapi.schema.CMField import com.schwarz.crystalapi.schema.CMList import com.schwarz.crystalapi.schema.CMType -fun ISelectLimitClause.offset(numberField: CMField): SelectOffsetClause = offset(numberField.asField()) +fun ISelectLimitClause.offset(numberField: CMField): SelectOffsetClause = offset(numberField.toDopeType()) -fun ISelectOrderByClause.limit(numberField: CMField): SelectLimitClause = limit(numberField.asField()) +fun ISelectOrderByClause.limit(numberField: CMField): SelectLimitClause = limit(numberField.toDopeType()) -fun ISelectGroupByClause.orderBy(stringField: CMField): SelectOrderByClause = orderBy(stringField.asField()) +fun ISelectGroupByClause.orderBy(stringField: CMField): SelectOrderByClause = orderBy(stringField.toDopeType()) fun ISelectGroupByClause.orderBy(stringField: CMField, orderByType: OrderByType): SelectOrderByClause = - orderBy(stringField.asField(), orderByType) + orderBy(stringField.toDopeType(), orderByType) fun ISelectWhereClause.groupBy(field: CMType, vararg fields: CMType): GroupByClause = - groupBy(field.asField(), *fields.map { it.asField() }.toTypedArray()) + groupBy(field.toDopeType(), *fields.map { it.toDopeType() }.toTypedArray()) -fun ISelectFromClause.where(whereExpression: CMField) = where(whereExpression.asField()) +fun ISelectFromClause.where(whereExpression: CMField) = where(whereExpression.toDopeType()) -fun ISelectJoinClause.join(bucket: Bucket, onKeys: CMField) = join(bucket, onKeys.asField()) -fun ISelectJoinClause.join(bucket: Bucket, onKey: CMField, forBucket: Bucket) = join(bucket, onKey.asField(), forBucket) +fun ISelectJoinClause.join(bucket: Bucket, onKeys: CMField) = join(bucket, onKeys.toDopeType()) +fun ISelectJoinClause.join(bucket: Bucket, onKey: CMField, forBucket: Bucket) = join(bucket, onKey.toDopeType(), forBucket) -fun ISelectJoinClause.innerJoin(bucket: Bucket, onKeys: CMField) = innerJoin(bucket, onKeys.asField()) -fun ISelectJoinClause.innerJoin(bucket: Bucket, onKey: CMField, forBucket: Bucket) = innerJoin(bucket, onKey.asField(), forBucket) +fun ISelectJoinClause.innerJoin(bucket: Bucket, onKeys: CMField) = innerJoin(bucket, onKeys.toDopeType()) +fun ISelectJoinClause.innerJoin(bucket: Bucket, onKey: CMField, forBucket: Bucket) = innerJoin(bucket, onKey.toDopeType(), forBucket) -fun ISelectJoinClause.leftJoin(bucket: Bucket, onKeys: CMField) = leftJoin(bucket, onKeys.asField()) -fun ISelectJoinClause.leftJoin(bucket: Bucket, onKey: CMField, forBucket: Bucket) = leftJoin(bucket, onKey.asField(), forBucket) +fun ISelectJoinClause.leftJoin(bucket: Bucket, onKeys: CMField) = leftJoin(bucket, onKeys.toDopeType()) +fun ISelectJoinClause.leftJoin(bucket: Bucket, onKey: CMField, forBucket: Bucket) = leftJoin(bucket, onKey.toDopeType(), forBucket) @JvmName("unnestString") -fun ISelectUnnestClause.unnest(arrayField: CMList) = unnest(arrayField.asArrayField()) +fun ISelectUnnestClause.unnest(arrayField: CMList) = unnest(arrayField.toDopeType()) @JvmName("unnestNumber") -fun ISelectUnnestClause.unnest(arrayField: CMList) = unnest(arrayField.asArrayField()) +fun ISelectUnnestClause.unnest(arrayField: CMList) = unnest(arrayField.toDopeType()) @JvmName("unnestBoolean") -fun ISelectUnnestClause.unnest(arrayField: CMList) = unnest(arrayField.asArrayField()) +fun ISelectUnnestClause.unnest(arrayField: CMList) = unnest(arrayField.toDopeType()) diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/arithmetic/Negation.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/arithmetic/Negation.kt index c009b85b..df794f8e 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/arithmetic/Negation.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/arithmetic/Negation.kt @@ -1,8 +1,8 @@ package ch.ergon.dope.extension.type.arithmetic -import ch.ergon.dope.asField import ch.ergon.dope.resolvable.expression.unaliased.type.arithmetic.NegationExpression import ch.ergon.dope.resolvable.expression.unaliased.type.arithmetic.neg +import ch.ergon.dope.toDopeType import com.schwarz.crystalapi.schema.CMField -fun neg(number: CMField): NegationExpression = neg(number.asField()) +fun neg(number: CMField): NegationExpression = neg(number.toDopeType()) diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/arithmetic/NumberInfix.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/arithmetic/NumberInfix.kt index 2e688d0f..9f0818d6 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/arithmetic/NumberInfix.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/arithmetic/NumberInfix.kt @@ -1,6 +1,5 @@ package ch.ergon.dope.extension.type.arithmetic -import ch.ergon.dope.asField import ch.ergon.dope.resolvable.expression.TypeExpression import ch.ergon.dope.resolvable.expression.unaliased.type.arithmetic.NumberInfixExpression import ch.ergon.dope.resolvable.expression.unaliased.type.arithmetic.add @@ -8,81 +7,82 @@ import ch.ergon.dope.resolvable.expression.unaliased.type.arithmetic.div import ch.ergon.dope.resolvable.expression.unaliased.type.arithmetic.mod import ch.ergon.dope.resolvable.expression.unaliased.type.arithmetic.mul import ch.ergon.dope.resolvable.expression.unaliased.type.arithmetic.sub -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType +import ch.ergon.dope.toDopeType import ch.ergon.dope.validtype.NumberType import com.schwarz.crystalapi.schema.CMField fun CMField.add(numberExpression: TypeExpression): NumberInfixExpression = - this.asField().add(numberExpression) + this.toDopeType().add(numberExpression) fun CMField.add(number: CMField): NumberInfixExpression = - this.asField().add(number.asField()) + this.toDopeType().add(number.toDopeType()) fun TypeExpression.add(number: CMField): NumberInfixExpression = - this.add(number.asField()) + this.add(number.toDopeType()) fun Number.add(number: CMField): NumberInfixExpression = - toNumberType().add(number.asField()) + toDopeType().add(number.toDopeType()) fun CMField.add(number: Number): NumberInfixExpression = - this.asField().add(number.toNumberType()) + this.toDopeType().add(number.toDopeType()) fun CMField.sub(numberExpression: TypeExpression): NumberInfixExpression = - this.asField().sub(numberExpression) + this.toDopeType().sub(numberExpression) fun CMField.sub(number: CMField): NumberInfixExpression = - this.asField().sub(number.asField()) + this.toDopeType().sub(number.toDopeType()) fun TypeExpression.sub(number: CMField): NumberInfixExpression = - this.sub(number.asField()) + this.sub(number.toDopeType()) fun Number.sub(number: CMField): NumberInfixExpression = - toNumberType().sub(number.asField()) + toDopeType().sub(number.toDopeType()) fun CMField.sub(number: Number): NumberInfixExpression = - this.asField().sub(number.toNumberType()) + this.toDopeType().sub(number.toDopeType()) fun CMField.mul(numberExpression: TypeExpression): NumberInfixExpression = - this.asField().mul(numberExpression) + this.toDopeType().mul(numberExpression) fun CMField.mul(number: CMField): NumberInfixExpression = - this.asField().mul(number.asField()) + this.toDopeType().mul(number.toDopeType()) fun TypeExpression.mul(number: CMField): NumberInfixExpression = - this.mul(number.asField()) + this.mul(number.toDopeType()) fun Number.mul(number: CMField): NumberInfixExpression = - toNumberType().mul(number.asField()) + toDopeType().mul(number.toDopeType()) fun CMField.mul(number: Number): NumberInfixExpression = - this.asField().mul(number.toNumberType()) + this.toDopeType().mul(number.toDopeType()) fun CMField.div(numberExpression: TypeExpression): NumberInfixExpression = - this.asField().div(numberExpression) + this.toDopeType().div(numberExpression) fun CMField.div(number: CMField): NumberInfixExpression = - this.asField().div(number.asField()) + this.toDopeType().div(number.toDopeType()) fun TypeExpression.div(number: CMField): NumberInfixExpression = - this.div(number.asField()) + this.div(number.toDopeType()) fun Number.div(number: CMField): NumberInfixExpression = - toNumberType().div(number.asField()) + toDopeType().div(number.toDopeType()) fun CMField.div(number: Number): NumberInfixExpression = - this.asField().div(number.toNumberType()) + this.toDopeType().div(number.toDopeType()) fun CMField.mod(numberExpression: TypeExpression): NumberInfixExpression = - this.asField().mod(numberExpression) + this.toDopeType().mod(numberExpression) fun CMField.mod(number: CMField): NumberInfixExpression = - this.asField().mod(number.asField()) + this.toDopeType().mod(number.toDopeType()) fun TypeExpression.mod(number: CMField): NumberInfixExpression = - this.mod(number.asField()) + this.mod(number.toDopeType()) fun Number.mod(number: CMField): NumberInfixExpression = - toNumberType().mod(number.asField()) + toDopeType().mod(number.toDopeType()) fun CMField.mod(number: Number): NumberInfixExpression = - this.asField().mod(number.toNumberType()) + this.toDopeType().mod(number.toDopeType()) diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/logical/LogicalInfix.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/logical/LogicalInfix.kt index c4e8a58a..df3dfd5a 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/logical/LogicalInfix.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/logical/LogicalInfix.kt @@ -1,40 +1,40 @@ package ch.ergon.dope.extension.type.logical -import ch.ergon.dope.asField import ch.ergon.dope.resolvable.expression.TypeExpression import ch.ergon.dope.resolvable.expression.unaliased.type.logical.LogicalInfixExpression import ch.ergon.dope.resolvable.expression.unaliased.type.logical.and import ch.ergon.dope.resolvable.expression.unaliased.type.logical.or -import ch.ergon.dope.resolvable.expression.unaliased.type.toBooleanType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType +import ch.ergon.dope.toDopeType import ch.ergon.dope.validtype.BooleanType import com.schwarz.crystalapi.schema.CMField fun TypeExpression.or(boolean: CMField): LogicalInfixExpression = - or(boolean.asField()) + or(boolean.toDopeType()) fun CMField.or(booleanExpression: TypeExpression): LogicalInfixExpression = - asField().or(booleanExpression) + toDopeType().or(booleanExpression) fun CMField.or(boolean: Boolean): LogicalInfixExpression = - asField().or(boolean.toBooleanType()) + toDopeType().or(boolean.toDopeType()) fun CMField.or(boolean: CMField): LogicalInfixExpression = - asField().or(boolean.asField()) + toDopeType().or(boolean.toDopeType()) fun Boolean.or(booleanExpression: CMField): LogicalInfixExpression = - toBooleanType().or(booleanExpression.asField()) + toDopeType().or(booleanExpression.toDopeType()) fun TypeExpression.and(boolean: CMField): LogicalInfixExpression = - and(boolean.asField()) + and(boolean.toDopeType()) fun CMField.and(booleanExpression: TypeExpression): LogicalInfixExpression = - asField().and(booleanExpression) + toDopeType().and(booleanExpression) fun CMField.and(boolean: Boolean): LogicalInfixExpression = - asField().and(boolean.toBooleanType()) + toDopeType().and(boolean.toDopeType()) fun CMField.and(boolean: CMField): LogicalInfixExpression = - asField().and(boolean.asField()) + toDopeType().and(boolean.toDopeType()) fun Boolean.and(booleanExpression: CMField): LogicalInfixExpression = - toBooleanType().and(booleanExpression.asField()) + toDopeType().and(booleanExpression.toDopeType()) diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/logical/Not.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/logical/Not.kt index e45d4b14..26ba9493 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/logical/Not.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/logical/Not.kt @@ -1,8 +1,8 @@ package ch.ergon.dope.extension.type.logical -import ch.ergon.dope.asField import ch.ergon.dope.resolvable.expression.unaliased.type.logical.NotExpression import ch.ergon.dope.resolvable.expression.unaliased.type.logical.not +import ch.ergon.dope.toDopeType import com.schwarz.crystalapi.schema.CMField -fun not(boolean: CMField): NotExpression = not(boolean.asField()) +fun not(boolean: CMField): NotExpression = not(boolean.toDopeType()) diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/Equals.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/Equals.kt index c6dc719d..494aa7b2 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/Equals.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/Equals.kt @@ -1,12 +1,10 @@ package ch.ergon.dope.extension.type.relational -import ch.ergon.dope.asField import ch.ergon.dope.resolvable.expression.TypeExpression import ch.ergon.dope.resolvable.expression.unaliased.type.relational.EqualsExpression import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isEqualTo -import ch.ergon.dope.resolvable.expression.unaliased.type.toBooleanType -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType +import ch.ergon.dope.toDopeType import ch.ergon.dope.validtype.BooleanType import ch.ergon.dope.validtype.NumberType import ch.ergon.dope.validtype.StringType @@ -14,60 +12,60 @@ import com.schwarz.crystalapi.schema.CMField @JvmName("isEqualToNumber") fun CMField.isEqualTo(right: Number): EqualsExpression = - asField().isEqualTo(right.toNumberType()) + toDopeType().isEqualTo(right.toDopeType()) @JvmName("isEqualToNumber") fun Number.isEqualTo(right: CMField): EqualsExpression = - toNumberType().isEqualTo(right.asField()) + toDopeType().isEqualTo(right.toDopeType()) @JvmName("isEqualToNumber") fun CMField.isEqualTo(right: CMField): EqualsExpression = - asField().isEqualTo(right.asField()) + toDopeType().isEqualTo(right.toDopeType()) @JvmName("isEqualToNumber") fun TypeExpression.isEqualTo(right: CMField): EqualsExpression = - isEqualTo(right.asField()) + isEqualTo(right.toDopeType()) @JvmName("isEqualToNumber") fun CMField.isEqualTo(right: TypeExpression): EqualsExpression = - asField().isEqualTo(right) + toDopeType().isEqualTo(right) @JvmName("isEqualToString") fun CMField.isEqualTo(right: String): EqualsExpression = - asField().isEqualTo(right.toStringType()) + toDopeType().isEqualTo(right.toDopeType()) @JvmName("isEqualToString") fun String.isEqualTo(right: CMField): EqualsExpression = - toStringType().isEqualTo(right.asField()) + toDopeType().isEqualTo(right.toDopeType()) @JvmName("isEqualToString") fun CMField.isEqualTo(right: CMField): EqualsExpression = - asField().isEqualTo(right.asField()) + toDopeType().isEqualTo(right.toDopeType()) @JvmName("isEqualToString") fun TypeExpression.isEqualTo(right: CMField): EqualsExpression = - isEqualTo(right.asField()) + isEqualTo(right.toDopeType()) @JvmName("isEqualToString") fun CMField.isEqualTo(right: TypeExpression): EqualsExpression = - asField().isEqualTo(right) + toDopeType().isEqualTo(right) @JvmName("isEqualToBoolean") fun CMField.isEqualTo(right: Boolean): EqualsExpression = - asField().isEqualTo(right.toBooleanType()) + toDopeType().isEqualTo(right.toDopeType()) @JvmName("isEqualToBoolean") fun Boolean.isEqualTo(right: CMField): EqualsExpression = - toBooleanType().isEqualTo(right.asField()) + toDopeType().isEqualTo(right.toDopeType()) @JvmName("isEqualToBoolean") fun CMField.isEqualTo(right: CMField): EqualsExpression = - asField().isEqualTo(right.asField()) + toDopeType().isEqualTo(right.toDopeType()) @JvmName("isEqualToBoolean") fun TypeExpression.isEqualTo(right: CMField): EqualsExpression = - isEqualTo(right.asField()) + isEqualTo(right.toDopeType()) @JvmName("isEqualToBoolean") fun CMField.isEqualTo(right: TypeExpression): EqualsExpression = - asField().isEqualTo(right) + toDopeType().isEqualTo(right) diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/GreaterOrEqualThan.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/GreaterOrEqualThan.kt index 07c00d61..5d0bebf4 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/GreaterOrEqualThan.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/GreaterOrEqualThan.kt @@ -1,51 +1,50 @@ package ch.ergon.dope.extension.type.relational -import ch.ergon.dope.asField import ch.ergon.dope.resolvable.expression.TypeExpression import ch.ergon.dope.resolvable.expression.unaliased.type.relational.GreaterOrEqualThanExpression import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isGreaterOrEqualThan -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType +import ch.ergon.dope.toDopeType import ch.ergon.dope.validtype.NumberType import ch.ergon.dope.validtype.StringType import com.schwarz.crystalapi.schema.CMField @JvmName("isGreaterOrEqualThanNumber") fun CMField.isGreaterOrEqualThan(right: CMField): GreaterOrEqualThanExpression = - asField().isGreaterOrEqualThan(right.asField()) + toDopeType().isGreaterOrEqualThan(right.toDopeType()) @JvmName("isGreaterOrEqualThanNumber") fun TypeExpression.isGreaterOrEqualThan(right: CMField): GreaterOrEqualThanExpression = - isGreaterOrEqualThan(right.asField()) + isGreaterOrEqualThan(right.toDopeType()) @JvmName("isGreaterOrEqualThanNumber") fun Number.isGreaterOrEqualThan(right: CMField): GreaterOrEqualThanExpression = - toNumberType().isGreaterOrEqualThan(right.asField()) + toDopeType().isGreaterOrEqualThan(right.toDopeType()) @JvmName("isGreaterOrEqualThanNumber") fun CMField.isGreaterOrEqualThan(right: TypeExpression): GreaterOrEqualThanExpression = - asField().isGreaterOrEqualThan(right) + toDopeType().isGreaterOrEqualThan(right) @JvmName("isGreaterOrEqualThanNumber") fun CMField.isGreaterOrEqualThan(right: Number): GreaterOrEqualThanExpression = - asField().isGreaterOrEqualThan(right.toNumberType()) + toDopeType().isGreaterOrEqualThan(right.toDopeType()) @JvmName("isGreaterOrEqualThanString") fun CMField.isGreaterOrEqualThan(right: CMField): GreaterOrEqualThanExpression = - asField().isGreaterOrEqualThan(right.asField()) + toDopeType().isGreaterOrEqualThan(right.toDopeType()) @JvmName("isGreaterOrEqualThanString") fun TypeExpression.isGreaterOrEqualThan(right: CMField): GreaterOrEqualThanExpression = - isGreaterOrEqualThan(right.asField()) + isGreaterOrEqualThan(right.toDopeType()) @JvmName("isGreaterOrEqualThanString") fun String.isGreaterOrEqualThan(right: CMField): GreaterOrEqualThanExpression = - toStringType().isGreaterOrEqualThan(right.asField()) + toDopeType().isGreaterOrEqualThan(right.toDopeType()) @JvmName("isGreaterOrEqualThanString") fun CMField.isGreaterOrEqualThan(right: TypeExpression): GreaterOrEqualThanExpression = - asField().isGreaterOrEqualThan(right) + toDopeType().isGreaterOrEqualThan(right) @JvmName("isGreaterOrEqualThanString") fun CMField.isGreaterOrEqualThan(right: String): GreaterOrEqualThanExpression = - asField().isGreaterOrEqualThan(right.toStringType()) + toDopeType().isGreaterOrEqualThan(right.toDopeType()) diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/GreaterThan.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/GreaterThan.kt index 39eb1584..6c6aba35 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/GreaterThan.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/GreaterThan.kt @@ -1,51 +1,50 @@ package ch.ergon.dope.extension.type.relational -import ch.ergon.dope.asField import ch.ergon.dope.resolvable.expression.TypeExpression import ch.ergon.dope.resolvable.expression.unaliased.type.relational.GreaterThanExpression import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isGreaterThan -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType +import ch.ergon.dope.toDopeType import ch.ergon.dope.validtype.NumberType import ch.ergon.dope.validtype.StringType import com.schwarz.crystalapi.schema.CMField @JvmName("isGreaterThanNumber") fun CMField.isGreaterThan(right: CMField): GreaterThanExpression = - asField().isGreaterThan(right.asField()) + toDopeType().isGreaterThan(right.toDopeType()) @JvmName("isGreaterThanNumber") fun TypeExpression.isGreaterThan(right: CMField): GreaterThanExpression = - isGreaterThan(right.asField()) + isGreaterThan(right.toDopeType()) @JvmName("isGreaterThanNumber") fun Number.isGreaterThan(right: CMField): GreaterThanExpression = - toNumberType().isGreaterThan(right.asField()) + toDopeType().isGreaterThan(right.toDopeType()) @JvmName("isGreaterThanNumber") fun CMField.isGreaterThan(right: TypeExpression): GreaterThanExpression = - asField().isGreaterThan(right) + toDopeType().isGreaterThan(right) @JvmName("isGreaterThanNumber") fun CMField.isGreaterThan(right: Number): GreaterThanExpression = - asField().isGreaterThan(right.toNumberType()) + toDopeType().isGreaterThan(right.toDopeType()) @JvmName("isGreaterThanString") fun CMField.isGreaterThan(right: CMField): GreaterThanExpression = - asField().isGreaterThan(right.asField()) + toDopeType().isGreaterThan(right.toDopeType()) @JvmName("isGreaterThanString") fun TypeExpression.isGreaterThan(right: CMField): GreaterThanExpression = - isGreaterThan(right.asField()) + isGreaterThan(right.toDopeType()) @JvmName("isGreaterThanString") fun String.isGreaterThan(right: CMField): GreaterThanExpression = - toStringType().isGreaterThan(right.asField()) + toDopeType().isGreaterThan(right.toDopeType()) @JvmName("isGreaterThanString") fun CMField.isGreaterThan(right: TypeExpression): GreaterThanExpression = - asField().isGreaterThan(right) + toDopeType().isGreaterThan(right) @JvmName("isGreaterThanString") fun CMField.isGreaterThan(right: String): GreaterThanExpression = - asField().isGreaterThan(right.toStringType()) + toDopeType().isGreaterThan(right.toDopeType()) diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/In.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/In.kt index 8a736f5a..53a00a11 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/In.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/In.kt @@ -1,14 +1,10 @@ package ch.ergon.dope.extension.type.relational -import ch.ergon.dope.asArrayField -import ch.ergon.dope.asField import ch.ergon.dope.resolvable.expression.TypeExpression import ch.ergon.dope.resolvable.expression.unaliased.type.relational.InExpression import ch.ergon.dope.resolvable.expression.unaliased.type.relational.inArray -import ch.ergon.dope.resolvable.expression.unaliased.type.toArrayType -import ch.ergon.dope.resolvable.expression.unaliased.type.toBooleanType -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType +import ch.ergon.dope.toDopeType import ch.ergon.dope.validtype.ArrayType import ch.ergon.dope.validtype.BooleanType import ch.ergon.dope.validtype.NumberType @@ -18,48 +14,48 @@ import com.schwarz.crystalapi.schema.CMList @JvmName("inArrayNumber") fun CMField.inArray(array: TypeExpression>): InExpression = - asField().inArray(array) + toDopeType().inArray(array) @JvmName("inArrayString") fun CMField.inArray(array: TypeExpression>): InExpression = - asField().inArray(array) + toDopeType().inArray(array) @JvmName("inArrayBoolean") fun CMField.inArray(array: TypeExpression>): InExpression = - asField().inArray(array) + toDopeType().inArray(array) @JvmName("inArrayNumber") fun CMField.inArray(array: CMList): InExpression = - asField().inArray(array.asArrayField()) + toDopeType().inArray(array.toDopeType()) @JvmName("inArrayString") fun CMField.inArray(array: CMList): InExpression = - asField().inArray(array.asArrayField()) + toDopeType().inArray(array.toDopeType()) @JvmName("inArrayBoolean") fun CMField.inArray(array: CMList): InExpression = - asField().inArray(array.asArrayField()) + toDopeType().inArray(array.toDopeType()) @JvmName("inArrayNumber") fun CMField.inArray(array: Collection>): InExpression = - asField().inArray(array.toArrayType()) + toDopeType().inArray(array.toDopeType()) @JvmName("inArrayString") fun CMField.inArray(array: Collection>): InExpression = - asField().inArray(array.toArrayType()) + toDopeType().inArray(array.toDopeType()) @JvmName("inArrayBoolean") fun CMField.inArray(array: Collection>): InExpression = - asField().inArray(array.toArrayType()) + toDopeType().inArray(array.toDopeType()) @JvmName("inArrayNumber") fun Number.inArray(array: CMList): InExpression = - toNumberType().inArray(array.asArrayField()) + toDopeType().inArray(array.toDopeType()) @JvmName("inArrayString") fun String.inArray(array: CMList): InExpression = - toStringType().inArray(array.asArrayField()) + toDopeType().inArray(array.toDopeType()) @JvmName("inArrayBoolean") fun Boolean.inArray(array: CMList): InExpression = - toBooleanType().inArray(array.asArrayField()) + toDopeType().inArray(array.toDopeType()) diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/IsMissing.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/IsMissing.kt index b6518859..91eea83f 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/IsMissing.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/IsMissing.kt @@ -1,14 +1,14 @@ package ch.ergon.dope.extension.type.relational -import ch.ergon.dope.asField import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isMissing +import ch.ergon.dope.toDopeType import com.schwarz.crystalapi.schema.CMField @JvmName("isMissingNumber") -fun CMField.isMissing() = asField().isMissing() +fun CMField.isMissing() = toDopeType().isMissing() @JvmName("isMissingString") -fun CMField.isMissing() = asField().isMissing() +fun CMField.isMissing() = toDopeType().isMissing() @JvmName("isMissingBoolean") -fun CMField.isMissing() = asField().isMissing() +fun CMField.isMissing() = toDopeType().isMissing() diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/IsNotMissing.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/IsNotMissing.kt index eae9f11a..bb451e46 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/IsNotMissing.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/IsNotMissing.kt @@ -1,14 +1,14 @@ package ch.ergon.dope.extension.type.relational -import ch.ergon.dope.asField import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isNotMissing +import ch.ergon.dope.toDopeType import com.schwarz.crystalapi.schema.CMField @JvmName("isNotMissingNumber") -fun CMField.isNotMissing() = asField().isNotMissing() +fun CMField.isNotMissing() = toDopeType().isNotMissing() @JvmName("isNotMissingString") -fun CMField.isNotMissing() = asField().isNotMissing() +fun CMField.isNotMissing() = toDopeType().isNotMissing() @JvmName("isNotMissingBoolean") -fun CMField.isNotMissing() = asField().isNotMissing() +fun CMField.isNotMissing() = toDopeType().isNotMissing() diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/IsNotNull.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/IsNotNull.kt index b62bfe84..e806039d 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/IsNotNull.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/IsNotNull.kt @@ -1,14 +1,14 @@ package ch.ergon.dope.extension.type.relational -import ch.ergon.dope.asField import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isNotNull +import ch.ergon.dope.toDopeType import com.schwarz.crystalapi.schema.CMField @JvmName("isNotNullNumber") -fun CMField.isNotNull() = asField().isNotNull() +fun CMField.isNotNull() = toDopeType().isNotNull() @JvmName("isNotNullString") -fun CMField.isNotNull() = asField().isNotNull() +fun CMField.isNotNull() = toDopeType().isNotNull() @JvmName("isNotNullBoolean") -fun CMField.isNotNull() = asField().isNotNull() +fun CMField.isNotNull() = toDopeType().isNotNull() diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/IsNotValued.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/IsNotValued.kt index 30c4b2a8..bbdd9b30 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/IsNotValued.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/IsNotValued.kt @@ -1,14 +1,14 @@ package ch.ergon.dope.extension.type.relational -import ch.ergon.dope.asField import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isNotValued +import ch.ergon.dope.toDopeType import com.schwarz.crystalapi.schema.CMField @JvmName("isNotValuedNumber") -fun CMField.isNotValued() = asField().isNotValued() +fun CMField.isNotValued() = toDopeType().isNotValued() @JvmName("isNotValuedString") -fun CMField.isNotValued() = asField().isNotValued() +fun CMField.isNotValued() = toDopeType().isNotValued() @JvmName("isNotValuedBoolean") -fun CMField.isNotValued() = asField().isNotValued() +fun CMField.isNotValued() = toDopeType().isNotValued() diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/IsNull.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/IsNull.kt index d6e2f479..a4973ffa 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/IsNull.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/IsNull.kt @@ -1,14 +1,14 @@ package ch.ergon.dope.extension.type.relational -import ch.ergon.dope.asField import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isNull +import ch.ergon.dope.toDopeType import com.schwarz.crystalapi.schema.CMField @JvmName("isNullNumber") -fun CMField.isNull() = asField().isNull() +fun CMField.isNull() = toDopeType().isNull() @JvmName("isNullString") -fun CMField.isNull() = asField().isNull() +fun CMField.isNull() = toDopeType().isNull() @JvmName("isNullBoolean") -fun CMField.isNull() = asField().isNull() +fun CMField.isNull() = toDopeType().isNull() diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/IsValued.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/IsValued.kt index 5de04dec..8b48f421 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/IsValued.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/IsValued.kt @@ -1,14 +1,14 @@ package ch.ergon.dope.extension.type.relational -import ch.ergon.dope.asField import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isValued +import ch.ergon.dope.toDopeType import com.schwarz.crystalapi.schema.CMField @JvmName("isValuedNumber") -fun CMField.isValued() = asField().isValued() +fun CMField.isValued() = toDopeType().isValued() @JvmName("isValuedString") -fun CMField.isValued() = asField().isValued() +fun CMField.isValued() = toDopeType().isValued() @JvmName("isValuedBoolean") -fun CMField.isValued() = asField().isValued() +fun CMField.isValued() = toDopeType().isValued() diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/LessOrEqualThan.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/LessOrEqualThan.kt index 12ac9017..20197520 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/LessOrEqualThan.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/LessOrEqualThan.kt @@ -1,51 +1,50 @@ package ch.ergon.dope.extension.type.relational -import ch.ergon.dope.asField import ch.ergon.dope.resolvable.expression.TypeExpression import ch.ergon.dope.resolvable.expression.unaliased.type.relational.LessOrEqualThanExpression import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isLessOrEqualThan -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType +import ch.ergon.dope.toDopeType import ch.ergon.dope.validtype.NumberType import ch.ergon.dope.validtype.StringType import com.schwarz.crystalapi.schema.CMField @JvmName("isLessOrEqualThanNumber") fun CMField.isLessOrEqualThan(right: CMField): LessOrEqualThanExpression = - asField().isLessOrEqualThan(right.asField()) + toDopeType().isLessOrEqualThan(right.toDopeType()) @JvmName("isLessOrEqualThanNumber") fun TypeExpression.isLessOrEqualThan(right: CMField): LessOrEqualThanExpression = - isLessOrEqualThan(right.asField()) + isLessOrEqualThan(right.toDopeType()) @JvmName("isLessOrEqualThanNumber") fun Number.isLessOrEqualThan(right: CMField): LessOrEqualThanExpression = - toNumberType().isLessOrEqualThan(right.asField()) + toDopeType().isLessOrEqualThan(right.toDopeType()) @JvmName("isLessOrEqualThanNumber") fun CMField.isLessOrEqualThan(right: TypeExpression): LessOrEqualThanExpression = - asField().isLessOrEqualThan(right) + toDopeType().isLessOrEqualThan(right) @JvmName("isLessOrEqualThanNumber") fun CMField.isLessOrEqualThan(right: Number): LessOrEqualThanExpression = - asField().isLessOrEqualThan(right.toNumberType()) + toDopeType().isLessOrEqualThan(right.toDopeType()) @JvmName("isLessOrEqualThanString") fun CMField.isLessOrEqualThan(right: CMField): LessOrEqualThanExpression = - asField().isLessOrEqualThan(right.asField()) + toDopeType().isLessOrEqualThan(right.toDopeType()) @JvmName("isLessOrEqualThanString") fun TypeExpression.isLessOrEqualThan(right: CMField): LessOrEqualThanExpression = - isLessOrEqualThan(right.asField()) + isLessOrEqualThan(right.toDopeType()) @JvmName("isLessOrEqualThanString") fun String.isLessOrEqualThan(right: CMField): LessOrEqualThanExpression = - toStringType().isLessOrEqualThan(right.asField()) + toDopeType().isLessOrEqualThan(right.toDopeType()) @JvmName("isLessOrEqualThanString") fun CMField.isLessOrEqualThan(right: TypeExpression): LessOrEqualThanExpression = - asField().isLessOrEqualThan(right) + toDopeType().isLessOrEqualThan(right) @JvmName("isLessOrEqualThanString") fun CMField.isLessOrEqualThan(right: String): LessOrEqualThanExpression = - asField().isLessOrEqualThan(right.toStringType()) + toDopeType().isLessOrEqualThan(right.toDopeType()) diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/LessThan.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/LessThan.kt index 263ea7b1..8e67d5c2 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/LessThan.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/LessThan.kt @@ -1,51 +1,50 @@ package ch.ergon.dope.extension.type.relational -import ch.ergon.dope.asField import ch.ergon.dope.resolvable.expression.TypeExpression import ch.ergon.dope.resolvable.expression.unaliased.type.relational.LessThanExpression import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isLessThan -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType +import ch.ergon.dope.toDopeType import ch.ergon.dope.validtype.NumberType import ch.ergon.dope.validtype.StringType import com.schwarz.crystalapi.schema.CMField @JvmName("isLessThanNumber") fun CMField.isLessThan(right: CMField): LessThanExpression = - asField().isLessThan(right.asField()) + toDopeType().isLessThan(right.toDopeType()) @JvmName("isLessThanNumber") fun TypeExpression.isLessThan(right: CMField): LessThanExpression = - isLessThan(right.asField()) + isLessThan(right.toDopeType()) @JvmName("isLessThanNumber") fun Number.isLessThan(right: CMField): LessThanExpression = - toNumberType().isLessThan(right.asField()) + toDopeType().isLessThan(right.toDopeType()) @JvmName("isLessThanNumber") fun CMField.isLessThan(right: TypeExpression): LessThanExpression = - asField().isLessThan(right) + toDopeType().isLessThan(right) @JvmName("isLessThanNumber") fun CMField.isLessThan(right: Number): LessThanExpression = - asField().isLessThan(right.toNumberType()) + toDopeType().isLessThan(right.toDopeType()) @JvmName("isLessThanString") fun CMField.isLessThan(right: CMField): LessThanExpression = - asField().isLessThan(right.asField()) + toDopeType().isLessThan(right.toDopeType()) @JvmName("isLessThanString") fun TypeExpression.isLessThan(right: CMField): LessThanExpression = - isLessThan(right.asField()) + isLessThan(right.toDopeType()) @JvmName("isLessThanString") fun String.isLessThan(right: CMField): LessThanExpression = - toStringType().isLessThan(right.asField()) + toDopeType().isLessThan(right.toDopeType()) @JvmName("isLessThanString") fun CMField.isLessThan(right: TypeExpression): LessThanExpression = - asField().isLessThan(right) + toDopeType().isLessThan(right) @JvmName("isLessThanString") fun CMField.isLessThan(right: String): LessThanExpression = - asField().isLessThan(right.toStringType()) + toDopeType().isLessThan(right.toDopeType()) diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/Like.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/Like.kt index 6682cc9a..d8272278 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/Like.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/Like.kt @@ -1,25 +1,25 @@ package ch.ergon.dope.extension.type.relational -import ch.ergon.dope.asField import ch.ergon.dope.resolvable.expression.TypeExpression import ch.ergon.dope.resolvable.expression.unaliased.type.Field import ch.ergon.dope.resolvable.expression.unaliased.type.relational.LikeExpression import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isLike -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType +import ch.ergon.dope.toDopeType import ch.ergon.dope.validtype.StringType import ch.ergon.dope.validtype.ValidType import com.schwarz.crystalapi.schema.CMField -fun Field.isLike(right: CMField): LikeExpression = isLike(right.asField()) +fun Field.isLike(right: CMField): LikeExpression = isLike(right.toDopeType()) @JvmName("isLikeNumber") -fun CMField.isLike(right: String): LikeExpression = asField().isLike(right.toStringType()) +fun CMField.isLike(right: String): LikeExpression = toDopeType().isLike(right.toDopeType()) @JvmName("isLikeString") -fun CMField.isLike(right: String): LikeExpression = asField().isLike(right.toStringType()) +fun CMField.isLike(right: String): LikeExpression = toDopeType().isLike(right.toDopeType()) @JvmName("isLikeString") -fun CMField.isLike(right: TypeExpression): LikeExpression = asField().isLike(right) +fun CMField.isLike(right: TypeExpression): LikeExpression = toDopeType().isLike(right) @JvmName("isLikeBoolean") -fun CMField.isLike(right: String): LikeExpression = asField().isLike(right.toStringType()) +fun CMField.isLike(right: String): LikeExpression = toDopeType().isLike(right.toDopeType()) diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/NotEquals.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/NotEquals.kt index 2ec4f2a2..2c2b52d8 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/NotEquals.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/NotEquals.kt @@ -1,12 +1,10 @@ package ch.ergon.dope.extension.type.relational -import ch.ergon.dope.asField import ch.ergon.dope.resolvable.expression.TypeExpression import ch.ergon.dope.resolvable.expression.unaliased.type.relational.NotEqualsExpression import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isNotEqualTo -import ch.ergon.dope.resolvable.expression.unaliased.type.toBooleanType -import ch.ergon.dope.resolvable.expression.unaliased.type.toNumberType -import ch.ergon.dope.resolvable.expression.unaliased.type.toStringType +import ch.ergon.dope.resolvable.expression.unaliased.type.toDopeType +import ch.ergon.dope.toDopeType import ch.ergon.dope.validtype.BooleanType import ch.ergon.dope.validtype.NumberType import ch.ergon.dope.validtype.StringType @@ -14,60 +12,60 @@ import com.schwarz.crystalapi.schema.CMField @JvmName("isNotEqualToNumber") fun CMField.isNotEqualTo(right: Number): NotEqualsExpression = - asField().isNotEqualTo(right.toNumberType()) + toDopeType().isNotEqualTo(right.toDopeType()) @JvmName("isNotEqualToNumber") fun Number.isNotEqualTo(right: CMField): NotEqualsExpression = - toNumberType().isNotEqualTo(right.asField()) + toDopeType().isNotEqualTo(right.toDopeType()) @JvmName("isNotEqualToNumber") fun CMField.isNotEqualTo(right: CMField): NotEqualsExpression = - asField().isNotEqualTo(right.asField()) + toDopeType().isNotEqualTo(right.toDopeType()) @JvmName("isNotEqualToNumber") fun TypeExpression.isNotEqualTo(right: CMField): NotEqualsExpression = - isNotEqualTo(right.asField()) + isNotEqualTo(right.toDopeType()) @JvmName("isNotEqualToNumber") fun CMField.isNotEqualTo(right: TypeExpression): NotEqualsExpression = - asField().isNotEqualTo(right) + toDopeType().isNotEqualTo(right) @JvmName("isNotEqualToString") fun CMField.isNotEqualTo(right: String): NotEqualsExpression = - asField().isNotEqualTo(right.toStringType()) + toDopeType().isNotEqualTo(right.toDopeType()) @JvmName("isNotEqualToString") fun String.isNotEqualTo(right: CMField): NotEqualsExpression = - toStringType().isNotEqualTo(right.asField()) + toDopeType().isNotEqualTo(right.toDopeType()) @JvmName("isNotEqualToString") fun CMField.isNotEqualTo(right: CMField): NotEqualsExpression = - asField().isNotEqualTo(right.asField()) + toDopeType().isNotEqualTo(right.toDopeType()) @JvmName("isNotEqualToString") fun TypeExpression.isNotEqualTo(right: CMField): NotEqualsExpression = - isNotEqualTo(right.asField()) + isNotEqualTo(right.toDopeType()) @JvmName("isNotEqualToString") fun CMField.isNotEqualTo(right: TypeExpression): NotEqualsExpression = - asField().isNotEqualTo(right) + toDopeType().isNotEqualTo(right) @JvmName("isNotEqualToBoolean") fun CMField.isNotEqualTo(right: Boolean): NotEqualsExpression = - asField().isNotEqualTo(right.toBooleanType()) + toDopeType().isNotEqualTo(right.toDopeType()) @JvmName("isNotEqualToBoolean") fun Boolean.isNotEqualTo(right: CMField): NotEqualsExpression = - toBooleanType().isNotEqualTo(right.asField()) + toDopeType().isNotEqualTo(right.toDopeType()) @JvmName("isNotEqualToBoolean") fun CMField.isNotEqualTo(right: CMField): NotEqualsExpression = - asField().isNotEqualTo(right.asField()) + toDopeType().isNotEqualTo(right.toDopeType()) @JvmName("isNotEqualToBoolean") fun TypeExpression.isNotEqualTo(right: CMField): NotEqualsExpression = - isNotEqualTo(right.asField()) + isNotEqualTo(right.toDopeType()) @JvmName("isNotEqualToBoolean") fun CMField.isNotEqualTo(right: TypeExpression): NotEqualsExpression = - asField().isNotEqualTo(right) + toDopeType().isNotEqualTo(right) diff --git a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/SatisfiesSchemaExpression.kt b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/SatisfiesSchemaExpression.kt index f3922474..1e028e27 100644 --- a/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/SatisfiesSchemaExpression.kt +++ b/crystal-map-connector/src/main/kotlin/ch/ergon/dope/extension/type/relational/SatisfiesSchemaExpression.kt @@ -1,8 +1,6 @@ package ch.ergon.dope.extension.type.relational import ch.ergon.dope.DopeQuery -import ch.ergon.dope.asArrayField -import ch.ergon.dope.asSchemaArray import ch.ergon.dope.resolvable.expression.TypeExpression import ch.ergon.dope.resolvable.expression.unaliased.type.relational.DEFAULT_ITERATOR_VARIABLE import ch.ergon.dope.resolvable.expression.unaliased.type.relational.Iterator @@ -12,6 +10,7 @@ import ch.ergon.dope.resolvable.expression.unaliased.type.relational.SatisfiesTy import ch.ergon.dope.resolvable.expression.unaliased.type.relational.SatisfiesType.EVERY import ch.ergon.dope.resolvable.expression.unaliased.type.relational.any import ch.ergon.dope.resolvable.expression.unaliased.type.relational.every +import ch.ergon.dope.toDopeType import ch.ergon.dope.validtype.BooleanType import ch.ergon.dope.validtype.DopeSchemaArray import ch.ergon.dope.validtype.NumberType @@ -74,25 +73,25 @@ fun DopeSchemaArray.any( fun CMObjectList.any( variable: String = DEFAULT_ITERATOR_VARIABLE, predicate: (SchemaIterator) -> TypeExpression, -) = AnySatisfiesSchemaExpression(variable, asSchemaArray(), predicate) +) = AnySatisfiesSchemaExpression(variable, toDopeType(), predicate) @JvmName("anyNumber") fun CMList.any( variable: String = DEFAULT_ITERATOR_VARIABLE, predicate: (Iterator) -> TypeExpression, -) = asArrayField().any(variable, predicate) +) = toDopeType().any(variable, predicate) @JvmName("anyString") fun CMList.any( variable: String = DEFAULT_ITERATOR_VARIABLE, predicate: (Iterator) -> TypeExpression, -) = asArrayField().any(variable, predicate) +) = toDopeType().any(variable, predicate) @JvmName("anyBoolean") fun CMList.any( variable: String = DEFAULT_ITERATOR_VARIABLE, predicate: (Iterator) -> TypeExpression, -) = asArrayField().any(variable, predicate) +) = toDopeType().any(variable, predicate) fun DopeSchemaArray.every( variable: String = DEFAULT_ITERATOR_VARIABLE, @@ -102,22 +101,22 @@ fun DopeSchemaArray.every( fun CMObjectList.every( variable: String = DEFAULT_ITERATOR_VARIABLE, predicate: (SchemaIterator) -> TypeExpression, -) = EverySatisfiesSchemaExpression(variable, asSchemaArray(), predicate) +) = EverySatisfiesSchemaExpression(variable, toDopeType(), predicate) @JvmName("everyNumber") fun CMList.every( variable: String = DEFAULT_ITERATOR_VARIABLE, predicate: (Iterator) -> TypeExpression, -) = asArrayField().every(variable, predicate) +) = toDopeType().every(variable, predicate) @JvmName("everyString") fun CMList.every( variable: String = DEFAULT_ITERATOR_VARIABLE, predicate: (Iterator) -> TypeExpression, -) = asArrayField().every(variable, predicate) +) = toDopeType().every(variable, predicate) @JvmName("everyBoolean") fun CMList.every( variable: String = DEFAULT_ITERATOR_VARIABLE, predicate: (Iterator) -> TypeExpression, -) = asArrayField().every(variable, predicate) +) = toDopeType().every(variable, predicate) diff --git a/crystal-map-connector/src/test/kotlin/ch/ergon/dope/CrystalMapAdapter.kt b/crystal-map-connector/src/test/kotlin/ch/ergon/dope/CrystalMapAdapter.kt index cb14cccc..eb86a808 100644 --- a/crystal-map-connector/src/test/kotlin/ch/ergon/dope/CrystalMapAdapter.kt +++ b/crystal-map-connector/src/test/kotlin/ch/ergon/dope/CrystalMapAdapter.kt @@ -15,7 +15,7 @@ class CrystalMapAdapter { fun `should convert CMField with Number`() { val cmField = CMField("testName", "testPath") - val actual: Field = cmField.asField() + val actual: Field = cmField.toDopeType() assertEquals("`${cmField.path}`.`${cmField.name}`", actual.toDopeQuery().queryString) } @@ -24,7 +24,7 @@ class CrystalMapAdapter { fun `should convert CMField with String`() { val cmField = CMField("testName", "testPath") - val actual: Field = cmField.asField() + val actual: Field = cmField.toDopeType() assertEquals("`${cmField.path}`.`${cmField.name}`", actual.toDopeQuery().queryString) } @@ -33,7 +33,7 @@ class CrystalMapAdapter { fun `should convert CMField with Boolean`() { val cmField = CMField("testName", "testPath") - val actual: Field = cmField.asField() + val actual: Field = cmField.toDopeType() assertEquals("`${cmField.path}`.`${cmField.name}`", actual.toDopeQuery().queryString) } @@ -42,7 +42,7 @@ class CrystalMapAdapter { fun `should convert CMList string`() { val cmList = CMList("testName", "testPath") - val actual: Field> = cmList.asArrayField() + val actual: Field> = cmList.toDopeType() assertEquals("`${cmList.path}`.`${cmList.name}`", actual.toDopeQuery().queryString) } @@ -51,7 +51,7 @@ class CrystalMapAdapter { fun `should convert CMList number`() { val cmList = CMList("testName", "testPath") - val actual: Field> = cmList.asArrayField() + val actual: Field> = cmList.toDopeType() assertEquals("`${cmList.path}`.`${cmList.name}`", actual.toDopeQuery().queryString) } @@ -60,7 +60,7 @@ class CrystalMapAdapter { fun `should convert CMList boolean`() { val cmList = CMList("testName", "testPath") - val actual: Field> = cmList.asArrayField() + val actual: Field> = cmList.toDopeType() assertEquals("`${cmList.path}`.`${cmList.name}`", actual.toDopeQuery().queryString) } diff --git a/crystal-map-connector/src/test/kotlin/ch/ergon/dope/extensions/type/relational/SatisfiesTest.kt b/crystal-map-connector/src/test/kotlin/ch/ergon/dope/extensions/type/relational/SatisfiesTest.kt index 3d027339..f34eee00 100644 --- a/crystal-map-connector/src/test/kotlin/ch/ergon/dope/extensions/type/relational/SatisfiesTest.kt +++ b/crystal-map-connector/src/test/kotlin/ch/ergon/dope/extensions/type/relational/SatisfiesTest.kt @@ -1,7 +1,6 @@ package ch.ergon.dope.extensions.type.relational import ch.ergon.dope.DopeQuery -import ch.ergon.dope.asSchemaArray import ch.ergon.dope.extension.type.relational.any import ch.ergon.dope.extension.type.relational.every import ch.ergon.dope.extension.type.relational.isEqualTo @@ -9,6 +8,7 @@ import ch.ergon.dope.resolvable.expression.unaliased.type.arithmetic.mod import ch.ergon.dope.resolvable.expression.unaliased.type.relational.IteratorManager import ch.ergon.dope.resolvable.expression.unaliased.type.relational.isEqualTo import ch.ergon.dope.resolvable.expression.unaliased.type.stringfunction.upper +import ch.ergon.dope.toDopeType import com.schwarz.crystalapi.schema.CMField import com.schwarz.crystalapi.schema.CMList import com.schwarz.crystalapi.schema.CMObjectList @@ -60,7 +60,7 @@ class SatisfiesTest { parameters = emptyMap(), ) - val actual = Dummy().objectList.asSchemaArray().any { schema -> + val actual = Dummy().objectList.toDopeType().any { schema -> schema.field { type }.isEqualTo("some value") }.toDopeQuery() @@ -139,7 +139,7 @@ class SatisfiesTest { parameters = emptyMap(), ) - val actual = Dummy().objectList.asSchemaArray().every { schema -> + val actual = Dummy().objectList.toDopeType().every { schema -> schema.field { type }.isEqualTo("some value") }.toDopeQuery()