DATAGEODE-341 - Delombok production source files.

This commit is contained in:
John Blum
2020-06-22 17:27:31 -07:00
parent 41a0521891
commit b0a05e8ed2
2 changed files with 74 additions and 15 deletions

View File

@@ -13,21 +13,42 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.gemfire.repository;
import lombok.NonNull;
import lombok.Value;
import org.springframework.lang.NonNull;
import org.springframework.util.Assert;
/**
* Simple value object holding an entity along with the external key in which the entity will be mapped.
* Simple {@link Object value object} holding an entity along with the external key in which the entity will be mapped.
*
* @author Oliver Gierke
* @author John Blum
*/
@Value
public class Wrapper<T, KEY> {
T entity;
@NonNull KEY key;
private final T entity;
private final KEY key;
public Wrapper(@NonNull T entity, @NonNull KEY key) {
Assert.notNull(entity, "Entity must not be null");
Assert.notNull(key, "Key must not be null");
this.entity = entity;
this.key = key;
}
public T getEntity() {
return this.entity;
}
public KEY getKey() {
return this.key;
}
@Override
public String toString() {
return String.format("{ key: %1$s, value: %2$s }", getKey(), getEntity());
}
}

View File

@@ -49,10 +49,7 @@ import org.springframework.data.util.ClassTypeInformation;
import org.springframework.data.util.TypeInformation;
import org.springframework.lang.NonNull;
import org.springframework.util.Assert;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.springframework.util.ObjectUtils;
/**
* {@link FactoryBean} adapter for {@link GemfireRepositoryFactory}.
@@ -326,13 +323,54 @@ public class GemfireRepositoryFactoryBean<T extends Repository<S, ID>, S, ID>
return repositoryQuery;
}
@EqualsAndHashCode
@RequiredArgsConstructor(staticName = "of")
private static class QueryPostProcessorKey {
@lombok.NonNull @Getter
QueryPostProcessor<?, ?> queryPostProcessor;
public static QueryPostProcessorKey of(QueryPostProcessor<?, ?> queryPostProcessor) {
return new QueryPostProcessorKey(queryPostProcessor);
}
private final QueryPostProcessor<?, ?> queryPostProcessor;
public QueryPostProcessorKey(@NonNull QueryPostProcessor<?, ?> queryPostProcessor) {
Assert.notNull(queryPostProcessor, "QueryPostProcessor must not be null");
this.queryPostProcessor = queryPostProcessor;
}
protected @NonNull QueryPostProcessor<?, ?> getQueryPostProcessor() {
return this.queryPostProcessor;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof QueryPostProcessorKey)) {
return false;
}
QueryPostProcessorKey that = (QueryPostProcessorKey) obj;
return this.getQueryPostProcessor().equals(that.getQueryPostProcessor());
}
@Override
public int hashCode() {
int hashValue = 17;
hashValue = 37 * hashValue + ObjectUtils.nullSafeHashCode(this.getQueryPostProcessor());
return hashValue;
}
@Override
public String toString() {
return String.format("{ queryPostProcessor: %s }", getQueryPostProcessor());
}
}
}
}