2013-03-18 09:50:48 +01:00
|
|
|
/**
|
2014-02-17 18:57:38 +01:00
|
|
|
*
|
2018-08-21 09:16:11 +02:00
|
|
|
* Copyright 2013-2018 Florian Schmaus
|
2014-02-17 18:57:38 +01:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
2013-03-18 09:50:48 +01:00
|
|
|
* 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.
|
|
|
|
*/
|
2014-09-04 11:04:51 +02:00
|
|
|
package org.jivesoftware.smack.util.stringencoder;
|
2013-03-18 09:50:48 +01:00
|
|
|
|
|
|
|
/**
|
2015-03-29 12:15:32 +02:00
|
|
|
* An interface for String encoder.
|
|
|
|
*
|
2013-03-18 09:50:48 +01:00
|
|
|
* @author Florian Schmaus
|
|
|
|
*/
|
2018-08-21 09:16:11 +02:00
|
|
|
public interface StringEncoder<O> {
|
2013-03-18 09:50:48 +01:00
|
|
|
/**
|
2018-08-21 09:16:11 +02:00
|
|
|
* Encodes an object to another representation.
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2018-08-21 09:16:11 +02:00
|
|
|
* @param object the object to encode.
|
2014-03-10 18:31:45 +01:00
|
|
|
* @return the encoded String
|
2013-03-18 09:50:48 +01:00
|
|
|
*/
|
2018-08-21 09:16:11 +02:00
|
|
|
String encode(O object);
|
2014-09-04 11:04:51 +02:00
|
|
|
|
2013-03-18 09:50:48 +01:00
|
|
|
/**
|
2018-08-21 09:16:11 +02:00
|
|
|
* Decodes a string back to it's initial representation.
|
2018-05-09 23:06:12 +02:00
|
|
|
*
|
2018-08-21 09:16:11 +02:00
|
|
|
* @param string the string to decode.
|
|
|
|
* @return the decoded object
|
2013-03-18 09:50:48 +01:00
|
|
|
*/
|
2018-08-21 09:16:11 +02:00
|
|
|
O decode(String string);
|
2013-03-18 09:50:48 +01:00
|
|
|
}
|