@@ -71,6 +71,8 @@ public String toString() {
71
71
private String capitalizedName ;
72
72
private String allCapsName ;
73
73
private boolean usingBeanConvention ;
74
+ private boolean inToString ;
75
+ private boolean inEqualsAndHashCode ;
74
76
private String getterName ;
75
77
private boolean fullyCheckedCast ;
76
78
private List <Excerpt > accessorAnnotations = ImmutableList .of ();
@@ -354,6 +356,79 @@ public boolean isUsingBeanConvention() {
354
356
return usingBeanConvention ;
355
357
}
356
358
359
+ /**
360
+ * Sets the value to be returned by {@link
361
+ * org.inferred.freebuilder.processor.property.Property#isInToString()}.
362
+ *
363
+ * @return this {@code Builder} object
364
+ */
365
+ public org .inferred .freebuilder .processor .property .Property .Builder setInToString (boolean inToString ) {
366
+ this .inToString = inToString ;
367
+ return (org .inferred .freebuilder .processor .property .Property .Builder ) this ;
368
+ }
369
+
370
+ /**
371
+ * Replaces the value to be returned by {@link
372
+ * org.inferred.freebuilder.processor.property.Property#isInToString()} by applying {@code mapper} to it
373
+ * and using the result.
374
+ *
375
+ * @return this {@code Builder} object
376
+ * @throws NullPointerException if {@code mapper} is null or returns null
377
+ * @throws IllegalStateException if the field has not been set
378
+ */
379
+ public org .inferred .freebuilder .processor .property .Property .Builder mapInToString (
380
+ UnaryOperator <Boolean > mapper ) {
381
+ Objects .requireNonNull (mapper );
382
+ return setInToString (mapper .apply (isInToString ()));
383
+ }
384
+
385
+ /**
386
+ * Returns the value that will be returned by {@link
387
+ * org.inferred.freebuilder.processor.property.Property#isInToString()}.
388
+ *
389
+ * @throws IllegalStateException if the field has not been set
390
+ */
391
+ public boolean isInToString () {
392
+ return inToString ;
393
+ }
394
+
395
+ /**
396
+ * Sets the value to be returned by {@link
397
+ * org.inferred.freebuilder.processor.property.Property#isInEqualsAndHashCode()}.
398
+ *
399
+ * @return this {@code Builder} object
400
+ */
401
+ public org .inferred .freebuilder .processor .property .Property .Builder setInEqualsAndHashCode (
402
+ boolean inEqualsAndHashCode ) {
403
+ this .inEqualsAndHashCode = inEqualsAndHashCode ;
404
+ return (org .inferred .freebuilder .processor .property .Property .Builder ) this ;
405
+ }
406
+
407
+ /**
408
+ * Replaces the value to be returned by {@link
409
+ * org.inferred.freebuilder.processor.property.Property#isInEqualsAndHashCode()} by applying {@code
410
+ * mapper} to it and using the result.
411
+ *
412
+ * @return this {@code Builder} object
413
+ * @throws NullPointerException if {@code mapper} is null or returns null
414
+ * @throws IllegalStateException if the field has not been set
415
+ */
416
+ public org .inferred .freebuilder .processor .property .Property .Builder mapInEqualsAndHashCode (
417
+ UnaryOperator <Boolean > mapper ) {
418
+ Objects .requireNonNull (mapper );
419
+ return setInEqualsAndHashCode (mapper .apply (isInEqualsAndHashCode ()));
420
+ }
421
+
422
+ /**
423
+ * Returns the value that will be returned by {@link
424
+ * org.inferred.freebuilder.processor.property.Property#isInEqualsAndHashCode()}.
425
+ *
426
+ * @throws IllegalStateException if the field has not been set
427
+ */
428
+ public boolean isInEqualsAndHashCode () {
429
+ return inEqualsAndHashCode ;
430
+ }
431
+
357
432
/**
358
433
* Sets the value to be returned by {@link
359
434
* org.inferred.freebuilder.processor.property.Property#getGetterName()}.
@@ -587,6 +662,12 @@ public org.inferred.freebuilder.processor.property.Property.Builder mergeFrom(
587
662
|| value .isUsingBeanConvention () != defaults .isUsingBeanConvention ()) {
588
663
setUsingBeanConvention (value .isUsingBeanConvention ());
589
664
}
665
+ if (!Objects .equals (value .isInToString (), defaults .isInToString ())) {
666
+ setInToString (value .isInToString ());
667
+ }
668
+ if (!Objects .equals (value .isInEqualsAndHashCode (), defaults .isInEqualsAndHashCode ())) {
669
+ setInEqualsAndHashCode (value .isInEqualsAndHashCode ());
670
+ }
590
671
if (defaults ._unsetProperties .contains (Property .GETTER_NAME )
591
672
|| !Objects .equals (value .getGetterName (), defaults .getGetterName ())) {
592
673
setGetterName (value .getGetterName ());
@@ -640,6 +721,12 @@ public org.inferred.freebuilder.processor.property.Property.Builder mergeFrom(
640
721
|| template .isUsingBeanConvention () != defaults .isUsingBeanConvention ())) {
641
722
setUsingBeanConvention (template .isUsingBeanConvention ());
642
723
}
724
+ if (template .isInToString () != defaults .isInToString ()) {
725
+ setInToString (template .isInToString ());
726
+ }
727
+ if (template .isInEqualsAndHashCode () != defaults .isInEqualsAndHashCode ()) {
728
+ setInEqualsAndHashCode (template .isInEqualsAndHashCode ());
729
+ }
643
730
if (!base ._unsetProperties .contains (Property .GETTER_NAME )
644
731
&& (defaults ._unsetProperties .contains (Property .GETTER_NAME )
645
732
|| !Objects .equals (template .getGetterName (), defaults .getGetterName ()))) {
@@ -667,6 +754,8 @@ public org.inferred.freebuilder.processor.property.Property.Builder clear() {
667
754
capitalizedName = defaults .capitalizedName ;
668
755
allCapsName = defaults .allCapsName ;
669
756
usingBeanConvention = defaults .usingBeanConvention ;
757
+ inToString = defaults .inToString ;
758
+ inEqualsAndHashCode = defaults .inEqualsAndHashCode ;
670
759
getterName = defaults .getterName ;
671
760
fullyCheckedCast = defaults .fullyCheckedCast ;
672
761
clearAccessorAnnotations ();
@@ -721,6 +810,8 @@ private static final class Value extends Rebuildable {
721
810
private final String capitalizedName ;
722
811
private final String allCapsName ;
723
812
private final boolean usingBeanConvention ;
813
+ private final boolean inToString ;
814
+ private final boolean inEqualsAndHashCode ;
724
815
private final String getterName ;
725
816
private final boolean fullyCheckedCast ;
726
817
private final ImmutableList <Excerpt > accessorAnnotations ;
@@ -732,6 +823,8 @@ private Value(Property_Builder builder) {
732
823
this .capitalizedName = builder .capitalizedName ;
733
824
this .allCapsName = builder .allCapsName ;
734
825
this .usingBeanConvention = builder .usingBeanConvention ;
826
+ this .inToString = builder .inToString ;
827
+ this .inEqualsAndHashCode = builder .inEqualsAndHashCode ;
735
828
this .getterName = builder .getterName ;
736
829
this .fullyCheckedCast = builder .fullyCheckedCast ;
737
830
this .accessorAnnotations = ImmutableList .copyOf (builder .accessorAnnotations );
@@ -767,6 +860,16 @@ public boolean isUsingBeanConvention() {
767
860
return usingBeanConvention ;
768
861
}
769
862
863
+ @ Override
864
+ public boolean isInToString () {
865
+ return inToString ;
866
+ }
867
+
868
+ @ Override
869
+ public boolean isInEqualsAndHashCode () {
870
+ return inEqualsAndHashCode ;
871
+ }
872
+
770
873
@ Override
771
874
public String getGetterName () {
772
875
return getterName ;
@@ -791,6 +894,8 @@ public Builder toBuilder() {
791
894
builder .capitalizedName = capitalizedName ;
792
895
builder .allCapsName = allCapsName ;
793
896
builder .usingBeanConvention = usingBeanConvention ;
897
+ builder .inToString = inToString ;
898
+ builder .inEqualsAndHashCode = inEqualsAndHashCode ;
794
899
builder .getterName = getterName ;
795
900
builder .fullyCheckedCast = fullyCheckedCast ;
796
901
builder .accessorAnnotations = accessorAnnotations ;
@@ -810,6 +915,8 @@ public boolean equals(Object obj) {
810
915
&& Objects .equals (capitalizedName , other .capitalizedName )
811
916
&& Objects .equals (allCapsName , other .allCapsName )
812
917
&& usingBeanConvention == other .usingBeanConvention
918
+ && inToString == other .inToString
919
+ && inEqualsAndHashCode == other .inEqualsAndHashCode
813
920
&& Objects .equals (getterName , other .getterName )
814
921
&& fullyCheckedCast == other .fullyCheckedCast
815
922
&& Objects .equals (accessorAnnotations , other .accessorAnnotations );
@@ -824,6 +931,8 @@ public int hashCode() {
824
931
capitalizedName ,
825
932
allCapsName ,
826
933
usingBeanConvention ,
934
+ inToString ,
935
+ inEqualsAndHashCode ,
827
936
getterName ,
828
937
fullyCheckedCast ,
829
938
accessorAnnotations );
@@ -844,6 +953,10 @@ public String toString() {
844
953
.append (allCapsName )
845
954
.append (", usingBeanConvention=" )
846
955
.append (usingBeanConvention )
956
+ .append (", inToString=" )
957
+ .append (inToString )
958
+ .append (", inEqualsAndHashCode=" )
959
+ .append (inEqualsAndHashCode )
847
960
.append (", getterName=" )
848
961
.append (getterName )
849
962
.append (", fullyCheckedCast=" )
@@ -865,6 +978,8 @@ private static final class Partial extends Rebuildable {
865
978
private final String capitalizedName ;
866
979
private final String allCapsName ;
867
980
private final boolean usingBeanConvention ;
981
+ private final boolean inToString ;
982
+ private final boolean inEqualsAndHashCode ;
868
983
private final String getterName ;
869
984
private final boolean fullyCheckedCast ;
870
985
private final ImmutableList <Excerpt > accessorAnnotations ;
@@ -877,6 +992,8 @@ private static final class Partial extends Rebuildable {
877
992
this .capitalizedName = builder .capitalizedName ;
878
993
this .allCapsName = builder .allCapsName ;
879
994
this .usingBeanConvention = builder .usingBeanConvention ;
995
+ this .inToString = builder .inToString ;
996
+ this .inEqualsAndHashCode = builder .inEqualsAndHashCode ;
880
997
this .getterName = builder .getterName ;
881
998
this .fullyCheckedCast = builder .fullyCheckedCast ;
882
999
this .accessorAnnotations = ImmutableList .copyOf (builder .accessorAnnotations );
@@ -928,6 +1045,16 @@ public boolean isUsingBeanConvention() {
928
1045
return usingBeanConvention ;
929
1046
}
930
1047
1048
+ @ Override
1049
+ public boolean isInToString () {
1050
+ return inToString ;
1051
+ }
1052
+
1053
+ @ Override
1054
+ public boolean isInEqualsAndHashCode () {
1055
+ return inEqualsAndHashCode ;
1056
+ }
1057
+
931
1058
@ Override
932
1059
public String getGetterName () {
933
1060
if (_unsetProperties .contains (Property .GETTER_NAME )) {
@@ -965,6 +1092,8 @@ public Builder toBuilder() {
965
1092
builder .capitalizedName = capitalizedName ;
966
1093
builder .allCapsName = allCapsName ;
967
1094
builder .usingBeanConvention = usingBeanConvention ;
1095
+ builder .inToString = inToString ;
1096
+ builder .inEqualsAndHashCode = inEqualsAndHashCode ;
968
1097
builder .getterName = getterName ;
969
1098
builder .fullyCheckedCast = fullyCheckedCast ;
970
1099
builder .accessorAnnotations = accessorAnnotations ;
@@ -985,6 +1114,8 @@ public boolean equals(Object obj) {
985
1114
&& Objects .equals (capitalizedName , other .capitalizedName )
986
1115
&& Objects .equals (allCapsName , other .allCapsName )
987
1116
&& usingBeanConvention == other .usingBeanConvention
1117
+ && inToString == other .inToString
1118
+ && inEqualsAndHashCode == other .inEqualsAndHashCode
988
1119
&& Objects .equals (getterName , other .getterName )
989
1120
&& fullyCheckedCast == other .fullyCheckedCast
990
1121
&& Objects .equals (accessorAnnotations , other .accessorAnnotations )
@@ -1000,6 +1131,8 @@ public int hashCode() {
1000
1131
capitalizedName ,
1001
1132
allCapsName ,
1002
1133
usingBeanConvention ,
1134
+ inToString ,
1135
+ inEqualsAndHashCode ,
1003
1136
getterName ,
1004
1137
fullyCheckedCast ,
1005
1138
accessorAnnotations ,
@@ -1027,6 +1160,8 @@ public String toString() {
1027
1160
if (!_unsetProperties .contains (Property .USING_BEAN_CONVENTION )) {
1028
1161
result .append ("usingBeanConvention=" ).append (usingBeanConvention ).append (", " );
1029
1162
}
1163
+ result .append ("inToString=" ).append (inToString ).append (", " );
1164
+ result .append ("inEqualsAndHashCode=" ).append (inEqualsAndHashCode ).append (", " );
1030
1165
if (!_unsetProperties .contains (Property .GETTER_NAME )) {
1031
1166
result .append ("getterName=" ).append (getterName ).append (", " );
1032
1167
}
0 commit comments