当前位置: 首页>>代码示例>>Java>>正文


Java VersionedValue类代码示例

本文整理汇总了Java中org.sdnplatform.sync.thrift.VersionedValue的典型用法代码示例。如果您正苦于以下问题:Java VersionedValue类的具体用法?Java VersionedValue怎么用?Java VersionedValue使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


VersionedValue类属于org.sdnplatform.sync.thrift包,在下文中一共展示了VersionedValue类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: iterator

import org.sdnplatform.sync.thrift.VersionedValue; //导入依赖的package包/类
@Override
public Iterator<Versioned<byte[]>> iterator() {
    final Iterator<VersionedValue> vs = tvvi.iterator();
    return new Iterator<Versioned<byte[]>>() {

        @Override
        public boolean hasNext() {
            return vs.hasNext();
        }

        @Override
        public Versioned<byte[]> next() {
            return TProtocolUtil.getVersionedValued(vs.next());
        }

        @Override
        public void remove() {
            vs.remove();
        }
    };
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:22,代码来源:TVersionedValueIterable.java

示例2: getTVersionedValue

import org.sdnplatform.sync.thrift.VersionedValue; //导入依赖的package包/类
/**
 * Allocate a thrift {@link org.sdnplatform.sync.thrift.VersionedValue}
 * object wrapping a {@link Versioned} object
 * @param value the value to wrap
 * @return the thrift object
 */
public static org.sdnplatform.sync.thrift.VersionedValue
    getTVersionedValue(Versioned<byte[]> value) {

    org.sdnplatform.sync.thrift.VersionedValue tvv =
            new org.sdnplatform.sync.thrift.VersionedValue();
    org.sdnplatform.sync.thrift.VectorClock tvc = 
            getTVectorClock((VectorClock)value.getVersion());
    
    tvv.setVersion(tvc);
    tvv.setValue(value.getValue());

    return tvv;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:20,代码来源:TProtocolUtil.java

示例3: getVersionedValued

import org.sdnplatform.sync.thrift.VersionedValue; //导入依赖的package包/类
/**
 * Convert a thrift {@link VersionedValue} into a {@link Versioned}.
 * @param tvv the {@link VersionedValue}
 * @return the {@link Versioned}
 */
public static Versioned<byte[]> 
        getVersionedValued(VersionedValue tvv) {
            Versioned<byte[]> vv =
            new Versioned<byte[]>(tvv.getValue(), 
                                  getVersion(tvv.getVersion()));
    return vv;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:13,代码来源:TProtocolUtil.java

示例4: getVersionedList

import org.sdnplatform.sync.thrift.VersionedValue; //导入依赖的package包/类
/**
 * Convert from a list of {@link VersionedValue} to a list 
 * of {@link Versioned<byte[]>}
 * @param tvv the list of versioned values
 * @return the list of versioned
 */
public static List<Versioned<byte[]>> getVersionedList(List<VersionedValue> tvv) {
    ArrayList<Versioned<byte[]>> values = 
            new ArrayList<Versioned<byte[]>>();
    if (tvv != null) {
        for (VersionedValue v : tvv) {
            values.add(TProtocolUtil.getVersionedValued(v));
        }
    }
    return values;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:17,代码来源:TProtocolUtil.java

示例5: getTVersionedValue

import org.sdnplatform.sync.thrift.VersionedValue; //导入依赖的package包/类
/**
 * Allocate a thrift {@link org.sdnplatform.sync.thrift.VersionedValue}
 * object wrapping a {@link Versioned} object
 * @param value the value to wrap
 * @return the thrift object
 */
public static org.sdnplatform.sync.thrift.VersionedValue
    getTVersionedValue(Versioned<byte[]> value) {

    org.sdnplatform.sync.thrift.VersionedValue tvv =
            new org.sdnplatform.sync.thrift.VersionedValue();
    org.sdnplatform.sync.thrift.VectorClock tvc =
            getTVectorClock((VectorClock)value.getVersion());

    tvv.setVersion(tvc);
    tvv.setValue(value.getValue());

    return tvv;
}
 
开发者ID:zhenshengcai,项目名称:floodlight-hardware,代码行数:20,代码来源:TProtocolUtil.java

示例6: getVersionedValued

import org.sdnplatform.sync.thrift.VersionedValue; //导入依赖的package包/类
/**
 * Convert a thrift {@link VersionedValue} into a {@link Versioned}.
 * @param tvv the {@link VersionedValue}
 * @return the {@link Versioned}
 */
public static Versioned<byte[]>
        getVersionedValued(VersionedValue tvv) {
            Versioned<byte[]> vv =
            new Versioned<byte[]>(tvv.getValue(),
                                  getVersion(tvv.getVersion()));
    return vv;
}
 
开发者ID:zhenshengcai,项目名称:floodlight-hardware,代码行数:13,代码来源:TProtocolUtil.java

示例7: getVersionedList

import org.sdnplatform.sync.thrift.VersionedValue; //导入依赖的package包/类
/**
 * Convert from a list of {@link VersionedValue} to a list
 * of {@link Versioned<byte[]>}
 * @param tvv the list of versioned values
 * @return the list of versioned
 */
public static List<Versioned<byte[]>> getVersionedList(List<VersionedValue> tvv) {
    ArrayList<Versioned<byte[]>> values =
            new ArrayList<Versioned<byte[]>>();
    if (tvv != null) {
        for (VersionedValue v : tvv) {
            values.add(TProtocolUtil.getVersionedValued(v));
        }
    }
    return values;
}
 
开发者ID:zhenshengcai,项目名称:floodlight-hardware,代码行数:17,代码来源:TProtocolUtil.java


注:本文中的org.sdnplatform.sync.thrift.VersionedValue类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。