org.apache.commons.lang3.tuple.MutablePair#getKey ( )源码实例Demo

下面列出了org.apache.commons.lang3.tuple.MutablePair#getKey ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: Diorite   文件: CommentsNodeImpl.java
@Override
@Nullable
public String getComment(String path)
{
    MutablePair<String, CommentsNodeImpl> nodePair = this.dataMap.get(path);
    if (nodePair != null)
    {
        String comment = nodePair.getLeft();
        if (comment != null)
        {
            return comment;
        }
    }
    MutablePair<String, CommentsNodeImpl> anyNodePair = this.dataMap.get(ANY);
    if (anyNodePair != null)
    {
        return anyNodePair.getKey();
    }
    return null;
}
 
源代码2 项目: doctorkafka   文件: OperatorUtil.java
public static MutablePair<Double, Double> getSysNetworkTraffic(long samplingWindowInMs)
    throws Exception {
  MutablePair<Long, Long> startNumbers = getProcNetDevStats();
  Thread.sleep(samplingWindowInMs);
  MutablePair<Long, Long> endNumbers = getProcNetDevStats();

  double inRate = (endNumbers.getKey() - startNumbers.getKey()) * 1000.0 / samplingWindowInMs;
  double outRate =
      (endNumbers.getValue() - startNumbers.getValue()) * 1000.0 / samplingWindowInMs;
  MutablePair<Double, Double> result = new MutablePair<>(inRate, outRate);
  return result;
}