FullCharacterDataWithOrigins.java 2.78 KB
package com.bitstrips.imoji.experiments;

import com.bitstrips.imoji.abv3.AvatarBuilderConfig;
import com.bitstrips.imoji.abv3.AvatarBuilderGender;
import com.bitstrips.imoji.abv3.AvatarBuilderSelection;
import com.bitstrips.imoji.abv3.AvatarBuilderStyle;
import com.bitstrips.imoji.abv3.model.AvatarLookAlike;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

public class FullCharacterDataWithOrigins
{
  private Map<String, Integer> a = new HashMap();
  private Map<String, String> b = new HashMap();
  
  public static FullCharacterDataWithOrigins Create(AvatarBuilderSelection paramAvatarBuilderSelection, AvatarBuilderConfig paramAvatarBuilderConfig)
  {
    FullCharacterDataWithOrigins localFullCharacterDataWithOrigins = new FullCharacterDataWithOrigins();
    Map localMap = paramAvatarBuilderConfig.getInitialUserAvatarData();
    AvatarLookAlike localAvatarLookAlike = paramAvatarBuilderSelection.getLookAlike();
    localFullCharacterDataWithOrigins.setOptions(localMap, OptionOrigin.UNKNOWN);
    if (localAvatarLookAlike != null) {
      localFullCharacterDataWithOrigins.setOptions(localAvatarLookAlike.getValueMap(), OptionOrigin.LOOKSERY);
    }
    localFullCharacterDataWithOrigins.setOptions(paramAvatarBuilderSelection.getSelectedOptions(), OptionOrigin.USER);
    localFullCharacterDataWithOrigins.setOption("gender", Integer.valueOf(paramAvatarBuilderConfig.getGender().getValue()), OptionOrigin.UNKNOWN);
    localFullCharacterDataWithOrigins.setOption("style", Integer.valueOf(paramAvatarBuilderConfig.getStyle().getValue()), OptionOrigin.UNKNOWN);
    return localFullCharacterDataWithOrigins;
  }
  
  public Map<String, Integer> getOptions()
  {
    return Collections.unmodifiableMap(this.a);
  }
  
  public Map<String, String> getOrigins()
  {
    return Collections.unmodifiableMap(this.b);
  }
  
  public void setOption(String paramString, Integer paramInteger, OptionOrigin paramOptionOrigin)
  {
    this.a.put(paramString, paramInteger);
    this.b.put(paramString, paramOptionOrigin.name());
  }
  
  public void setOptions(Map<String, Integer> paramMap, OptionOrigin paramOptionOrigin)
  {
    paramMap = paramMap.entrySet().iterator();
    while (paramMap.hasNext())
    {
      Map.Entry localEntry = (Map.Entry)paramMap.next();
      setOption((String)localEntry.getKey(), (Integer)localEntry.getValue(), paramOptionOrigin);
    }
  }
  
  public static enum OptionOrigin
  {
    static
    {
      UNKNOWN = new OptionOrigin("UNKNOWN", 1);
    }
    
    private OptionOrigin() {}
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/com/bitstrips/imoji/experiments/FullCharacterDataWithOrigins.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */