20
20
21
21
import java .util .Optional ;
22
22
23
+ import org .jspecify .annotations .NonNull ;
23
24
import org .jspecify .annotations .Nullable ;
24
25
25
26
import org .apache .causeway .applib .exceptions .unrecoverable .ObjectNotFoundException ;
32
33
import org .apache .causeway .commons .internal .exceptions ._Exceptions ;
33
34
import org .apache .causeway .commons .internal .ref .TransientObjectRef ;
34
35
import org .apache .causeway .core .metamodel .facets .object .entity .EntityFacet ;
35
- import org .apache .causeway .core .metamodel .facets .object .title .TitleRenderRequest ;
36
36
import org .apache .causeway .core .metamodel .object .ManagedObject .Specialization ;
37
- import org .apache .causeway .core .metamodel .objectmanager .memento .ObjectMemento ;
38
37
import org .apache .causeway .core .metamodel .spec .ObjectSpecification ;
39
38
40
- import org .jspecify .annotations .NonNull ;
41
39
import lombok .extern .log4j .Log4j2 ;
42
40
43
41
/**
44
42
* (package private) specialization corresponding to a attached {@link Specialization#ENTITY}
45
43
* @see ManagedObject.Specialization#ENTITY
46
44
*/
47
45
@ Log4j2
48
- record ManagedObjectEntityBookmarked (
46
+ record EntityPhaseBookmarked (
49
47
@ NonNull ObjectSpecification objSpec ,
50
48
@ NonNull TransientObjectRef <Object > pojoRef ,
51
49
@ NonNull Bookmark bookmark )
52
- implements ManagedObject , _Refetchable {
50
+ implements EntityPhase , _Refetchable {
53
51
54
- ManagedObjectEntityBookmarked (
52
+ EntityPhaseBookmarked (
55
53
final ObjectSpecification objSpec ,
56
54
final Object pojo ,
57
55
final @ NonNull Optional <Bookmark > bookmarkIfKnown ) {
58
56
this (objSpec , new TransientObjectRef <>(pojo ), bookmarkIfKnown .orElse (null ));
59
57
}
60
58
61
- ManagedObjectEntityBookmarked (
59
+ EntityPhaseBookmarked (
62
60
final ObjectSpecification objSpec ,
63
61
final TransientObjectRef <Object > pojoRef ,
64
62
@ Nullable final Bookmark bookmark ) {
@@ -72,32 +70,6 @@ record ManagedObjectEntityBookmarked(
72
70
.orElseGet (this ::createBookmark );
73
71
}
74
72
75
- @ Override
76
- public Specialization specialization () {
77
- return ManagedObject .Specialization .ENTITY ;
78
- }
79
-
80
- @ Override
81
- public String getTitle () {
82
- return _InternalTitleUtil .titleString (
83
- TitleRenderRequest .forObject (this ));
84
- }
85
-
86
- @ Override
87
- public Optional <ObjectMemento > getMemento () {
88
- return Optional .ofNullable (ObjectMemento .singularOrEmpty (this ));
89
- }
90
-
91
- @ Override
92
- public Optional <Bookmark > getBookmark () {
93
- return Optional .of (bookmark );
94
- }
95
-
96
- @ Override
97
- public boolean isBookmarkMemoized () {
98
- return true ;
99
- }
100
-
101
73
@ Override
102
74
public Object peekAtPojo () {
103
75
return pojoRef .getObject ();
@@ -127,24 +99,11 @@ public Object getPojo() {
127
99
return entityFacet ().getEntityState (peekAtPojo ());
128
100
}
129
101
130
- @ Override
131
- public final boolean equals (final Object obj ) {
132
- return _Compliance .equals (this , obj );
133
- }
134
-
135
- @ Override
136
- public final int hashCode () {
137
- return _Compliance .hashCode (this );
138
- }
139
-
140
- @ Override
141
- public final String toString () {
142
- return _Compliance .toString (this );
143
- }
144
-
145
102
// -- HELPER
146
103
147
- // private boolean refetching;
104
+ private Specialization specialization () {
105
+ return ManagedObject .Specialization .ENTITY ;
106
+ }
148
107
149
108
private Object refetchPojo (final EntityState entityState ) {
150
109
0 commit comments