|
@@ -3,63 +3,51 @@ |
3 |
3 |
|
import org.litesoft.commonfoundation.annotations.*; |
4 |
4 |
|
import org.litesoft.commonfoundation.base.*; |
5 |
5 |
|
|
6 |
|
- |
public class MasterValidatedEntry extends Key |
7 |
|
- |
{ |
8 |
|
- |
public enum State |
9 |
|
- |
{ |
|
6 |
+ |
public class MasterValidatedEntry extends Key { |
|
7 |
+ |
public enum State { |
10 |
8 |
|
Unchecked, NoProblem, Empty, InvalidKey, SourceChanged |
11 |
9 |
|
} |
12 |
10 |
|
|
13 |
|
- |
public MasterValidatedEntry( @SignificantText String pKey, @SignificantText String pUnvalidatedValue ) |
14 |
|
- |
{ |
|
11 |
+ |
public MasterValidatedEntry( @SignificantText String pKey, @SignificantText String pUnvalidatedValue ) { |
15 |
12 |
|
super( pKey ); |
16 |
13 |
|
unvalidatedValue = Confirm.significant( "UnvalidatedValue", pUnvalidatedValue ); |
17 |
14 |
|
} |
18 |
15 |
|
|
19 |
|
- |
public MasterValidatedEntry( @NotNull MasterUnvalidatedEntry pUnvalidatedEntry ) |
20 |
|
- |
{ |
|
16 |
+ |
public MasterValidatedEntry( @NotNull MasterUnvalidatedEntry pUnvalidatedEntry ) { |
21 |
17 |
|
this( pUnvalidatedEntry.getKey(), pUnvalidatedEntry.getValue() ); |
22 |
18 |
|
} |
23 |
19 |
|
|
24 |
|
- |
public @NotNull String getUnvalidatedValue() |
25 |
|
- |
{ |
|
20 |
+ |
public @NotNull String getUnvalidatedValue() { |
26 |
21 |
|
return unvalidatedValue; |
27 |
22 |
|
} |
28 |
23 |
|
|
29 |
|
- |
public @NullOrSignificantText String getValidatedValue() |
30 |
|
- |
{ |
|
24 |
+ |
public @NullOrSignificantText String getValidatedValue() { |
31 |
25 |
|
return validatedValue; |
32 |
26 |
|
} |
33 |
27 |
|
|
34 |
|
- |
public void setValidatedValue( @SignificantText String pValidatedValue ) |
35 |
|
- |
{ |
|
28 |
+ |
public void setValidatedValue( @SignificantText String pValidatedValue ) { |
36 |
29 |
|
validatedValue = Confirm.significant( "ValidatedValue", pValidatedValue ); |
37 |
30 |
|
} |
38 |
31 |
|
|
39 |
|
- |
public @NotNull State getState() |
40 |
|
- |
{ |
|
32 |
+ |
public @NotNull State getState() { |
41 |
33 |
|
return mState; |
42 |
34 |
|
} |
43 |
35 |
|
|
44 |
|
- |
public State check( @Nullable MasterUnvalidatedEntry pUnvalidatedEntry ) |
45 |
|
- |
{ |
46 |
|
- |
if ( (pUnvalidatedEntry == null) || !this.getKey().equals( pUnvalidatedEntry.getKey() ) ) |
47 |
|
- |
{ |
|
36 |
+ |
public State check( @Nullable MasterUnvalidatedEntry pUnvalidatedEntry ) { |
|
37 |
+ |
if ( (pUnvalidatedEntry == null) || !this.getKey().equals( pUnvalidatedEntry.getKey() ) ) { |
48 |
38 |
|
return mState = State.InvalidKey; |
49 |
39 |
|
} |
50 |
|
- |
if (!this.getUnvalidatedValue().equals( pUnvalidatedEntry.getValue() )) { |
|
40 |
+ |
if ( !this.getUnvalidatedValue().equals( pUnvalidatedEntry.getValue() ) ) { |
51 |
41 |
|
return mState = State.SourceChanged; |
52 |
42 |
|
} |
53 |
43 |
|
return mState = (null == getValidatedValue()) ? State.Empty : State.NoProblem; |
54 |
44 |
|
} |
55 |
45 |
|
|
56 |
|
- |
public State update( @NotNull MasterUnvalidatedEntry pUnvalidatedEntry ) |
57 |
|
- |
{ |
58 |
|
- |
if ( (pUnvalidatedEntry == null) || !this.getKey().equals( pUnvalidatedEntry.getKey() ) ) |
59 |
|
- |
{ |
|
46 |
+ |
public State update( @NotNull MasterUnvalidatedEntry pUnvalidatedEntry ) { |
|
47 |
+ |
if ( (pUnvalidatedEntry == null) || !this.getKey().equals( pUnvalidatedEntry.getKey() ) ) { |
60 |
48 |
|
return mState = State.InvalidKey; |
61 |
49 |
|
} |
62 |
|
- |
if (!this.getUnvalidatedValue().equals( pUnvalidatedEntry.getValue() )) { |
|
50 |
+ |
if ( !this.getUnvalidatedValue().equals( pUnvalidatedEntry.getValue() ) ) { |
63 |
51 |
|
return mState = State.SourceChanged; |
64 |
52 |
|
} |
65 |
53 |
|
return mState = (null == getValidatedValue()) ? State.Empty : State.NoProblem; |
|
@@ -71,7 +59,6 @@ |
71 |
59 |
|
private transient State mState = State.Unchecked; |
72 |
60 |
|
|
73 |
61 |
|
@Deprecated /** for Serialization */ |
74 |
|
- |
protected MasterValidatedEntry() |
75 |
|
- |
{ |
|
62 |
+ |
protected MasterValidatedEntry() { |
76 |
63 |
|
} |
77 |
64 |
|
} |