-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
97926da
commit ec99412
Showing
7 changed files
with
248 additions
and
144 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
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
26 changes: 25 additions & 1 deletion
26
stream-core/src/main/java/org/dromara/streamquery/stream/core/bean/Converter.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 |
---|---|---|
@@ -1,10 +1,34 @@ | ||
/* | ||
* 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.dromara.streamquery.stream.core.bean; | ||
|
||
/** | ||
* Converter | ||
* | ||
* @author [email protected] | ||
* @param <S> source type | ||
* @param <T> target type | ||
*/ | ||
public interface Converter<S, T> { | ||
T convert(S source); | ||
/** | ||
* convert | ||
* | ||
* @param source source | ||
* @return target | ||
*/ | ||
T convert(S source); | ||
} |
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 |
---|---|---|
@@ -1,3 +1,19 @@ | ||
/* | ||
* 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.dromara.streamquery.stream.core.bean; | ||
|
||
import java.util.Objects; | ||
|
@@ -8,35 +24,41 @@ | |
* @author [email protected] | ||
*/ | ||
public class ConverterKey { | ||
private Class<?> sourceType; | ||
private Class<?> targetType; | ||
private Class<?> sourceType; | ||
private Class<?> targetType; | ||
|
||
public Class<?> getSourceType() { | ||
return sourceType; | ||
} | ||
public Class<?> getSourceType() { | ||
return sourceType; | ||
} | ||
|
||
public void setSourceType(Class<?> sourceType) { | ||
this.sourceType = sourceType; | ||
} | ||
public void setSourceType(Class<?> sourceType) { | ||
this.sourceType = sourceType; | ||
} | ||
|
||
public Class<?> getTargetType() { | ||
return targetType; | ||
} | ||
public Class<?> getTargetType() { | ||
return targetType; | ||
} | ||
|
||
public void setTargetType(Class<?> targetType) { | ||
this.targetType = targetType; | ||
} | ||
public void setTargetType(Class<?> targetType) { | ||
this.targetType = targetType; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
ConverterKey that = (ConverterKey) o; | ||
return Objects.equals(sourceType, that.sourceType) && Objects.equals(targetType, that.targetType); | ||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(sourceType, targetType); | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
ConverterKey that = (ConverterKey) o; | ||
return Objects.equals(sourceType, that.sourceType) | ||
&& Objects.equals(targetType, that.targetType); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(sourceType, targetType); | ||
} | ||
} |
Oops, something went wrong.