using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Linq;
using System.Globalization;
using System.ComponentModel;
using System.Collections;
namespace LeanCloud.Storage.Internal
{
///
/// So here's the deal. We have a lot of internal APIs for AVObject, AVUser, etc.
///
/// These cannot be 'internal' anymore if we are fully modularizing things out, because
/// they are no longer a part of the same library, especially as we create things like
/// Installation inside push library.
///
/// So this class contains a bunch of extension methods that can live inside another
/// namespace, which 'wrap' the intenral APIs that already exist.
///
public static class AVObjectExtensions
{
public static T FromState(IObjectState state, string defaultClassName) where T : AVObject
{
return AVObject.FromState(state, defaultClassName);
}
public static IObjectState GetState(this AVObject obj)
{
return obj.State;
}
public static void HandleFetchResult(this AVObject obj, IObjectState serverState)
{
obj.HandleFetchResult(serverState);
}
public static IDictionary GetCurrentOperations(this AVObject obj)
{
return obj.CurrentOperations;
}
public static IDictionary Encode(this AVObject obj)
{
return PointerOrLocalIdEncoder.Instance.EncodeAVObject(obj, false);
}
public static IEnumerable