81 Arrays.
equals(other.coveringExpressionOffsets, coveringExpressionOffsets) &&
82 Arrays.equals(other.coveringExpressionLengths, coveringExpressionLengths) &&
83 ObjectUtilities.equals(other.names, names) &&
84 Arrays.equals(other.offsets, offsets) &&
85 Arrays.equals(other.lengths, lengths);
91 int[] coveringExpressionOffsets = jsonObject.get(
"coveringExpressionOffsets") ==
null ? null : JsonUtilities.decodeIntArray(jsonObject.get(
"coveringExpressionOffsets").getAsJsonArray());
92 int[] coveringExpressionLengths = jsonObject.get(
"coveringExpressionLengths") ==
null ? null : JsonUtilities.decodeIntArray(jsonObject.get(
"coveringExpressionLengths").getAsJsonArray());
93 List<String> names = JsonUtilities.decodeStringList(jsonObject.get(
"names").getAsJsonArray());
94 int[] offsets = JsonUtilities.decodeIntArray(jsonObject.get(
"offsets").getAsJsonArray());
95 int[] lengths = JsonUtilities.decodeIntArray(jsonObject.get(
"lengths").getAsJsonArray());
162 JsonObject jsonObject =
new JsonObject();
163 if (coveringExpressionOffsets !=
null) {
164 JsonArray jsonArrayCoveringExpressionOffsets =
new JsonArray();
165 for (
int elt : coveringExpressionOffsets) {
166 jsonArrayCoveringExpressionOffsets.add(
new JsonPrimitive(elt));
168 jsonObject.add(
"coveringExpressionOffsets", jsonArrayCoveringExpressionOffsets);
170 if (coveringExpressionLengths !=
null) {
171 JsonArray jsonArrayCoveringExpressionLengths =
new JsonArray();
172 for (
int elt : coveringExpressionLengths) {
173 jsonArrayCoveringExpressionLengths.add(
new JsonPrimitive(elt));
175 jsonObject.add(
"coveringExpressionLengths", jsonArrayCoveringExpressionLengths);
177 JsonArray jsonArrayNames =
new JsonArray();
178 for (String elt : names) {
179 jsonArrayNames.add(
new JsonPrimitive(elt));
181 jsonObject.add(
"names", jsonArrayNames);
182 JsonArray jsonArrayOffsets =
new JsonArray();
183 for (
int elt : offsets) {
184 jsonArrayOffsets.add(
new JsonPrimitive(elt));
186 jsonObject.add(
"offsets", jsonArrayOffsets);
187 JsonArray jsonArrayLengths =
new JsonArray();
188 for (
int elt : lengths) {
189 jsonArrayLengths.add(
new JsonPrimitive(elt));
191 jsonObject.add(
"lengths", jsonArrayLengths);
197 StringBuilder builder =
new StringBuilder();
199 builder.append(
"coveringExpressionOffsets=");
200 builder.append(StringUtils.join(coveringExpressionOffsets,
", ") +
", ");
201 builder.append(
"coveringExpressionLengths=");
202 builder.append(StringUtils.join(coveringExpressionLengths,
", ") +
", ");
203 builder.append(
"names=");
204 builder.append(StringUtils.join(names,
", ") +
", ");
205 builder.append(
"offsets=");
206 builder.append(StringUtils.join(offsets,
", ") +
", ");
207 builder.append(
"lengths=");
208 builder.append(StringUtils.join(lengths,
", "));
210 return builder.toString();