//-----------------------------------------------------------------------
//
// Copyright (c) Outercurve Foundation. All rights reserved.
//
//-----------------------------------------------------------------------
namespace DotNetOpenAuth.Messaging.Reflection {
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Validation;
///
/// An interface describing how various objects can be serialized and deserialized between their object and string forms.
///
///
/// Implementations of this interface must include a default constructor and must be thread-safe.
///
public interface IMessagePartEncoder {
///
/// Encodes the specified value.
///
/// The value. Guaranteed to never be null.
/// The in string form, ready for message transport.
string Encode(object value);
///
/// Decodes the specified value.
///
/// The string value carried by the transport. Guaranteed to never be null, although it may be empty.
/// The deserialized form of the given string.
/// Thrown when the string value given cannot be decoded into the required object type.
object Decode(string value);
}
}