-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CAUSEWAY-3859: Java record refactoring (part 47)
- Loading branch information
1 parent
c6bcceb
commit 5cfc8c8
Showing
15 changed files
with
131 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 0 additions & 54 deletions
54
...ket/model/src/main/java/org/apache/causeway/viewer/wicket/model/links/MenuablesModel.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
...t/model/src/main/java/org/apache/causeway/viewer/wicket/model/models/DelegatingModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.apache.causeway.viewer.wicket.model.models; | ||
|
||
import org.apache.wicket.model.IModel; | ||
|
||
//TODO[causeway-viewer-wicket-model-CAUSEWAY-3859] intermediate refactoring helper, perhaps remove later | ||
public class DelegatingModel<T> implements IModel<T> { | ||
private static final long serialVersionUID = 1L; | ||
|
||
private IModel<T> delegate; | ||
|
||
public DelegatingModel(final IModel<T> modelObject) { | ||
this.delegate = modelObject; | ||
} | ||
|
||
@Override | ||
public final void detach() { | ||
if(delegate!=null) delegate.detach(); | ||
} | ||
|
||
@Override | ||
public final void setObject(final T object) { | ||
delegate.setObject(object); | ||
} | ||
|
||
@Override | ||
public final T getObject() { | ||
return delegate!=null | ||
? delegate.getObject() | ||
: null; | ||
} | ||
|
||
public final IModel<?> getChainedModel() { | ||
return delegate; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return new StringBuilder("Model:classname=[") | ||
.append(getClass().getName()).append(']') | ||
.append(":nestedModel=[").append(delegate).append(']') | ||
.toString(); | ||
} | ||
|
||
public final Object getInnermostModelOrObject() { | ||
Object object = delegate; | ||
while (object instanceof IModel) { | ||
Object tmp = ((IModel<?>)object).getObject(); | ||
if (tmp == object) break; | ||
object = tmp; | ||
} | ||
return object; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 0 additions & 69 deletions
69
.../src/main/java/org/apache/causeway/viewer/wicket/model/models/binding/BooleanBinding.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.