// Path: Redis-Synyed-common/src/main/java/com/wmz7year/synyed/constant/RedisRDBConstant.java
// public static final byte REDIS_ENCODING_ZIPLIST = 5; /*
// 
// Path: Redis-Synyed-common/src/main/java/com/wmz7year/synyed/constant/RedisRDBConstant.java
// public static final byte REDIS_HASH = 4;


import static com.wmz7year.synyed.constant.RedisRDBConstant.REDIS_ENCODING_ZIPLIST;
import static com.wmz7year.synyed.constant.RedisRDBConstant.REDIS_HASH;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
package com.wmz7year.synyed.parser.entry;



/**
 * redis hash类型的对象
 * 
 * @Title: RedisHashObject.java
 * @Package com.wmz7year.synyed.parser.entry
 * @author jiangwei (ydswcy513@gmail.com)
 * @date 2015年12月16日 下午5:05:17
 * @version V1.0
 */
public class RedisHashObject extends RedisObject {

	private Map<RedisObject, RedisObject> elements = new HashMap<RedisObject, RedisObject>();

	public RedisHashObject() {

	}

	/**
	 * 添加元素的方法
	 * 
	 * @param field
	 *            field
	 * @param value
	 *            value
	 */
	public void addElement(RedisObject field, RedisObject value) {
		if (!(field instanceof RedisStringObject)) {
			throw new IllegalStateException("元素类型错误 必须为RedisStringObject类型");
		}
		if (!(value instanceof RedisStringObject)) {
			throw new IllegalStateException("元素类型错误 必须为RedisStringObject类型");
		}
		elements.put(field, value);
	}

	/*
	 * @see com.wmz7year.synyed.parser.entry.RedisObject#getType()
	 */
	@Override
	public byte getType() {
// Path: Redis-Synyed-common/src/main/java/com/wmz7year/synyed/constant/RedisRDBConstant.java
// public static final byte REDIS_ENCODING_ZIPLIST = 5; /*
// 
// Path: Redis-Synyed-common/src/main/java/com/wmz7year/synyed/constant/RedisRDBConstant.java
// public static final byte REDIS_HASH = 4;


// Path: Redis-Synyed-common/src/main/java/com/wmz7year/synyed/parser/entry/RedisHashObject.java
import static com.wmz7year.synyed.constant.RedisRDBConstant.REDIS_ENCODING_ZIPLIST;
import static com.wmz7year.synyed.constant.RedisRDBConstant.REDIS_HASH;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;

package com.wmz7year.synyed.parser.entry;



/**
 * redis hash类型的对象
 * 
 * @Title: RedisHashObject.java
 * @Package com.wmz7year.synyed.parser.entry
 * @author jiangwei (ydswcy513@gmail.com)
 * @date 2015年12月16日 下午5:05:17
 * @version V1.0
 */
public class RedisHashObject extends RedisObject {

	private Map<RedisObject, RedisObject> elements = new HashMap<RedisObject, RedisObject>();

	public RedisHashObject() {

	}

	/**
	 * 添加元素的方法
	 * 
	 * @param field
	 *            field
	 * @param value
	 *            value
	 */
	public void addElement(RedisObject field, RedisObject value) {
		if (!(field instanceof RedisStringObject)) {
			throw new IllegalStateException("元素类型错误 必须为RedisStringObject类型");
		}
		if (!(value instanceof RedisStringObject)) {
			throw new IllegalStateException("元素类型错误 必须为RedisStringObject类型");
		}
		elements.put(field, value);
	}

	/*
	 * @see com.wmz7year.synyed.parser.entry.RedisObject#getType()
	 */
	@Override
	public byte getType() {
		return REDIS_HASH;