Skip to content

Commit

Permalink
docs: enhane documentation
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <otaviopolianasantana@gmail.com>
  • Loading branch information
otaviojava committed Mar 2, 2024
1 parent d77cb3e commit 8314049
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ public int hashCode() {

@Override
public String toString() {
return "ColumnCondition{" +
"column=" + element +
return "CriteriaCondition{" +
"element=" + element +
", condition=" + condition +
'}';
}
Expand Down Expand Up @@ -283,13 +283,12 @@ public static CriteriaCondition lt(String name, Object value) {
}

/**
* Creates a {@link CriteriaCondition} with a {@link Condition#LESSER_EQUALS_THAN},
* indicating that a select will scan a column family with the same name and the value
* lesser or equal to the one provided in this column.
* Creates a new {@link CriteriaCondition} with a {@link Condition#LESSER_EQUALS_THAN} condition.
* This indicates that a select operation will scan data with the same element name and a value lesser than or equal to the provided value.
*
* @param element a column instance
* @param element the element representing the data to match
* @return a {@link CriteriaCondition} with {@link Condition#LESSER_EQUALS_THAN}
* @throws NullPointerException when the column is null
* @throws NullPointerException when the element is null
*/
public static CriteriaCondition lte(Element element) {
return new CriteriaCondition(element, Condition.LESSER_EQUALS_THAN);
Expand All @@ -299,8 +298,8 @@ public static CriteriaCondition lte(Element element) {
* An alias method to {@link CriteriaCondition#lte(Element)}, which first creates an {@link Element}
* instance and then applies the condition.
*
* @param name the name of the column
* @param value the column information
* @param name the name of the element
* @param value the value of the element
* @return a {@link CriteriaCondition} with {@link Condition#LESSER_EQUALS_THAN}
* @throws NullPointerException when either the name or the value is null
*/
Expand All @@ -311,16 +310,16 @@ public static CriteriaCondition lte(String name, Object value) {
}

/**
* Creates a {@link CriteriaCondition} with a {@link Condition#IN}, indicating that a select will scan a
* column family with the same name and the value within the provided collection.
* Creates a {@link CriteriaCondition} with a {@link Condition#IN}, indicating that a select will scan a semistructured NoSQL
* database with the same name and the value within the provided collection.
*
* @param element a column instance
* @param element an element instance
* @return a {@link CriteriaCondition} with {@link Condition#IN}
* @throws NullPointerException when the column is null
* @throws NullPointerException when the element is null
* @throws IllegalArgumentException when the {@link Element#get()} is not an iterable implementation
*/
public static CriteriaCondition in(Element element) {
Objects.requireNonNull(element, "Column is required");
Objects.requireNonNull(element, "element is required");
checkInClause(element.value());
return new CriteriaCondition(element, Condition.IN);
}
Expand All @@ -329,8 +328,8 @@ public static CriteriaCondition in(Element element) {
* An alias method to {@link CriteriaCondition#in(Element)}, which first creates an {@link Element}
* instance and then applies the condition.
*
* @param name the name of the column
* @param value the column information
* @param name the name of the element
* @param value the element information
* @return a {@link CriteriaCondition} with {@link Condition#IN}
* @throws NullPointerException when either the name or the value is null
*/
Expand All @@ -342,11 +341,11 @@ public static CriteriaCondition in(String name, Object value) {

/**
* Creates a {@link CriteriaCondition} with a {@link Condition#LIKE}, indicating that a select will scan a
* column family with the same name and the value is like the one provided in this column.
* semistructured NoSQL database with the same name and the value is like the one provided in this element.
*
* @param element a column instance
* @param element an element instance
* @return a {@link CriteriaCondition} with {@link Condition#LIKE}
* @throws NullPointerException when the column is null
* @throws NullPointerException when the element is null
*/
public static CriteriaCondition like(Element element) {
return new CriteriaCondition(element, Condition.LIKE);
Expand All @@ -356,8 +355,8 @@ public static CriteriaCondition like(Element element) {
* An alias method to {@link CriteriaCondition#like(Element)}, which first creates an {@link Element}
* instance and then applies the condition.
*
* @param name the name of the column
* @param value the column information
* @param name the name of the element
* @param value the element information
* @return a {@link CriteriaCondition} with {@link Condition#LIKE}
* @throws NullPointerException when either the name or the value is null
*/
Expand All @@ -378,7 +377,7 @@ public static CriteriaCondition like(String name, Object value) {
* @throws IllegalArgumentException when the element is not an iterable with two elements
*/
public static CriteriaCondition between(Element element) {
Objects.requireNonNull(element, "Column is required");
Objects.requireNonNull(element, "element is required");
checkBetweenClause(element.get());
return new CriteriaCondition(element, Condition.BETWEEN);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,14 +330,14 @@ interface DeleteQueryBuilder {
DeleteQueryBuilder delete(String... columns);

/**
* Define the column family in the query, this element is mandatory to build
* Define the entity in the query, this element is mandatory to build
* the {@link DeleteQueryBuilder}.
*
* @param columnFamily the column family to query
* @param entity the entity name to query
* @return the {@link DeleteQueryBuilder}
* @throws NullPointerException when columnFamily is null
* @throws NullPointerException when entity is null
*/
DeleteQueryBuilder from(String columnFamily);
DeleteQueryBuilder from(String entity);

/**
* Either add or replace the condition in the query. It has a different behavior than the previous method
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ interface QueryBuilder {
QueryBuilder sort(Sort<?>... sorts);

/**
* Define the column family in the query, this element is mandatory to build the {@link SelectQuery}.
* Define the entity in the query, this element is mandatory to build the {@link SelectQuery}.
*
* @param entity the entity to query
* @return the {@link QueryBuilder}
Expand Down

0 comments on commit 8314049

Please sign in to comment.