Skip to content

Commit bd15ccb

Browse files
committed
add a few missing javadoc
1 parent c1daaa1 commit bd15ccb

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

src/main/java/dev/efekos/simple_ql/data/AdaptedList.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,40 @@ public class AdaptedList<T> implements TableRowTypeAdapter, Iterable<T> {
6969
private final List<T> list;
7070
private final Implementor<T, String> implementor;
7171

72+
/**
73+
* Creates a new list.
74+
* @param implementor Implementor that will be used while converting this list into a {@link String}.
75+
*/
7276
public AdaptedList(Implementor<T, String> implementor) {
7377
this.list = new ArrayList<>();
7478
this.implementor = implementor;
7579
}
7680

81+
/**
82+
* Creates a clone of the given list.
83+
* @param list A list to add elements of.
84+
* @param implementor Implementor that will be used while converting this list into a {@link String}.
85+
*/
7786
public AdaptedList(List<T> list, Implementor<T, String> implementor) {
7887
this.list = list;
7988
this.implementor = implementor;
8089
}
8190

91+
/**
92+
* Returns a clone of the given list.
93+
* @param list Any {@link AdaptedList}.
94+
* @return Clone of the given list.
95+
* @param <TY> Type of the list.
96+
*/
8297
public static <TY> AdaptedList<TY> clone(AdaptedList<TY> list) {
8398
return new AdaptedList<>(list.list, list.implementor);
8499
}
85100

101+
/**
102+
* Reads the given {@link String} and converts it into a {@link AdaptedList}.
103+
* @param i Input string.
104+
* @return A {@link AdaptedList} instance that represents the given {@link String}.
105+
*/
86106
@SuppressWarnings("unchecked")
87107
public static AdaptedList<Object> readAdapted(String i) {
88108
String[] split = i.split(IMPLEMENTOR_SEPARATOR + "");
@@ -108,6 +128,10 @@ public static AdaptedList<Object> readAdapted(String i) {
108128
}
109129
}
110130

131+
/**
132+
* Converts this list into a {@link String}.
133+
* @return A string.
134+
*/
111135
@Override
112136
public String adapt() {
113137
if (list.isEmpty()) return implementor.getClass().getName() + IMPLEMENTOR_SEPARATOR + ARRAY_START + ARRAY_END;

src/main/java/dev/efekos/simple_ql/data/TableRow.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ public void markDirty() {
9090
for (Field field : clazz.getDeclaredFields()) markDirty(field.getName());
9191
}
9292

93+
/**
94+
* Marks a specific field dirty. Should be used by EVERY setter in order for a {@link TableRow} subclass to work.
95+
* @param name Name of the field/column.
96+
*/
9397
protected void markDirty(String name) {
9498
dirtyFields.add(name);
9599
}

0 commit comments

Comments
 (0)