Skip to content

Commit

Permalink
merge: #4148 again?
Browse files Browse the repository at this point in the history
  • Loading branch information
Cervator committed Sep 19, 2020
2 parents fa04a55 + 7890da9 commit eff0c05
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 78 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,6 @@ private boolean doesSubclassMatch(Class<?> subclass, String subTypeIdentifier) {
return Objects.equals(givenModuleName, providingModule) && subTypeName.toString().equals(subclass.getSimpleName());
}

@Override
public <T> String getSubTypeIdentifier(Class<? extends T> subType, Class<T> baseType) {
return subType.getName();
}

@Override
public <T> boolean isValidTypeHandlerDeclaration(TypeInfo<T> type, TypeHandler<T> typeHandler) {
Name moduleDeclaringHandler = getModuleProviding(typeHandler.getClass());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
/*
* Copyright 2019 MovingBlocks
*
* Licensed 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.
*/
// Copyright 2020 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.persistence.typeHandling.reflection;

import org.reflections.Reflections;
Expand Down Expand Up @@ -43,11 +30,6 @@ public <T> Optional<Class<? extends T>> findSubTypeOf(String subTypeIdentifier,
return Optional.empty();
}

@Override
public <T> String getSubTypeIdentifier(Class<? extends T> subType, Class<T> baseType) {
return subType.getName();
}

@Override
public <T> boolean isValidTypeHandlerDeclaration(TypeInfo<T> type, TypeHandler<T> typeHandler) {
return true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
/*
* Copyright 2019 MovingBlocks
*
* Licensed 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.
*/
// Copyright 2020 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.persistence.typeHandling.reflection;

import org.terasology.persistence.typeHandling.TypeHandler;
Expand Down Expand Up @@ -46,7 +33,9 @@ public interface SerializationSandbox {
* @param <T> The base type whose subtype needs to be identified.
* @return The unique identifier for {@code subType}.
*/
<T> String getSubTypeIdentifier(Class<? extends T> subType, Class<T> baseType);
default <T> String getSubTypeIdentifier(Class<? extends T> subType, Class<T> baseType) {
return subType.getName();
}

/**
* Checks whether the given {@link TypeHandler} should be allowed to handle instances of
Expand Down

0 comments on commit eff0c05

Please sign in to comment.