コード例 #1
0
ファイル: OPMLExporter.java プロジェクト: edoardoo/commafeed
  public Opml export(User user) {
    Opml opml = new Opml();
    opml.setFeedType("opml_1.1");
    opml.setTitle(String.format("%s subscriptions in CommaFeed", user.getName()));
    opml.setCreated(new Date());

    List<FeedCategory> categories = feedCategoryDAO.findAll(user);
    Collections.sort(
        categories,
        (e1, e2) ->
            MoreObjects.firstNonNull(e1.getPosition(), 0)
                - MoreObjects.firstNonNull(e2.getPosition(), 0));

    List<FeedSubscription> subscriptions = feedSubscriptionDAO.findAll(user);
    Collections.sort(
        subscriptions,
        (e1, e2) ->
            MoreObjects.firstNonNull(e1.getPosition(), 0)
                - MoreObjects.firstNonNull(e2.getPosition(), 0));

    // export root categories
    for (FeedCategory cat :
        categories.stream().filter(c -> c.getParent() == null).collect(Collectors.toList())) {
      opml.getOutlines().add(buildCategoryOutline(cat, categories, subscriptions));
    }

    // export root subscriptions
    for (FeedSubscription sub :
        subscriptions.stream().filter(s -> s.getCategory() == null).collect(Collectors.toList())) {
      opml.getOutlines().add(buildSubscriptionOutline(sub));
    }

    return opml;
  }
コード例 #2
0
ファイル: ObjectsDemo.java プロジェクト: xuyuanfa/guava-demo
 private static void toStringHelper() {
   System.out.println(
       MoreObjects.toStringHelper(ObjectsDemo.class)
           .add("x", 1)
           .toString()); // Returns "ClassName{x=1}"
   System.out.println(
       MoreObjects.toStringHelper("MyObject").add("x", 1).toString()); // Returns "MyObject{x=1}"
 }
コード例 #3
0
 @Override
 public String toString() {
   if (IPV4_LEN == lsAttrLength) {
     return MoreObjects.toStringHelper(getClass())
         .omitNullValues()
         .add("ip4RouterId", ip4RouterId)
         .toString();
   } else {
     return MoreObjects.toStringHelper(getClass())
         .omitNullValues()
         .add("ip6RouterId", ip6RouterId)
         .toString();
   }
 }
コード例 #4
0
  @Override
  public String toString() {
    ToStringHelper stringHelper =
        MoreObjects.toStringHelper(getClass()).add("id", getId()).add("requests", getRequests());

    return stringHelper.toString();
  }
コード例 #5
0
ファイル: MetricsFactory.java プロジェクト: RVRhub/dropwizard
 @Override
 public String toString() {
   return MoreObjects.toStringHelper(this)
       .add("frequency", frequency)
       .add("reporters", reporters)
       .toString();
 }
コード例 #6
0
 @Override
 public String toString() {
   return MoreObjects.toStringHelper(this)
       .add("equivalenceRatio", equivalenceRatio)
       .add("voltage", voltage)
       .toString();
 }
コード例 #7
0
ファイル: ReturnPeriod.java プロジェクト: usgs/nshmp-haz
 @Override
 public String toString() {
   return MoreObjects.toStringHelper(getClass().getSimpleName() + "." + name())
       .add("annualRate", annualRate)
       .add("duration", duration())
       .toString();
 }
コード例 #8
0
 @Override
 public String toString() {
   return MoreObjects.toStringHelper(this)
       .add("channelId", channelId)
       .add("securityPolicy", securityPolicy)
       .toString();
 }
コード例 #9
0
ファイル: BgpAttrRouterIdV6.java プロジェクト: wangqilei/onos
 @Override
 public String toString() {
   return MoreObjects.toStringHelper(getClass())
       .omitNullValues()
       .add("ip6RouterId", ip6RouterId)
       .toString();
 }
コード例 #10
0
 @Override
 public String toString() {
   return MoreObjects.toStringHelper(this)
       .add("hostname", hostname)
       .add("domainname", domainname)
       .add("username", user)
       .add("attachStdin", attachStdin)
       .add("attachStdout", attachStdout)
       .add("attachStderr", attachStderr)
       .add("portSpecs", portSpecs)
       .add("exposedPorts", exposedPorts)
       .add("tty", tty)
       .add("openStdin", openStdin)
       .add("stdinOnce", stdinOnce)
       .add("env", env)
       .add("cmd", cmd)
       .add("image", image)
       .add("volumes", volumes)
       .add("workingDir", workingDir)
       .add("entrypoint", entrypoint)
       .add("networkDisabled", networkDisabled)
       .add("onBuild", onBuild)
       .add("labels", labels)
       .add("macAddress", macAddress)
       .add("hostConfig", hostConfig)
       .add("stopSignal", stopSignal)
       .toString();
 }
コード例 #11
0
 @Override
 public String toString() {
   return MoreObjects.toStringHelper(this)
       .add("code", getStatusCode())
       .add("message", getStatusMessage())
       .toString();
 }
コード例 #12
0
 @Override
 public String toString() {
   return MoreObjects.toStringHelper(Attribute.class)
       .add("name", name)
       .add("value", value)
       .toString();
 }
コード例 #13
0
 @Override
 public String toString() {
   return MoreObjects.toStringHelper(this.getClass())
       .add("propertiesOne", propertiesOne)
       .add("propertiesTwo", propertiesTwo)
       .toString();
 }
コード例 #14
0
 @Override
 public String toString() {
   return MoreObjects.toStringHelper(getClass())
       .omitNullValues()
       .add("linkStateRequests", linkStateRequests)
       .toString();
 }
コード例 #15
0
 @Override
 public final String toString() {
   return MoreObjects.toStringHelper(this)
       .add("indexName", indexName)
       .add("documentType", documentType)
       .toString();
 }
コード例 #16
0
  private <T> void evaluateBundle(
      final AppliedPTransform<?, ?, ?> transform,
      final CommittedBundle<T> bundle,
      final CompletionCallback onComplete) {
    TransformExecutorService transformExecutor;

    if (isKeyed(bundle.getPCollection())) {
      final StepAndKey stepAndKey = StepAndKey.of(transform, bundle.getKey());
      // This executor will remain reachable until it has executed all scheduled transforms.
      // The TransformExecutors keep a strong reference to the Executor, the ExecutorService keeps
      // a reference to the scheduled TransformExecutor callable. Follow-up TransformExecutors
      // (scheduled due to the completion of another TransformExecutor) are provided to the
      // ExecutorService before the Earlier TransformExecutor callable completes.
      transformExecutor = executorServices.getUnchecked(stepAndKey);
    } else {
      transformExecutor = parallelExecutorService;
    }

    Collection<ModelEnforcementFactory> enforcements =
        MoreObjects.firstNonNull(
            transformEnforcements.get(transform.getTransform().getClass()),
            Collections.<ModelEnforcementFactory>emptyList());

    TransformExecutor<T> callable =
        TransformExecutor.create(
            evaluationContext,
            registry,
            enforcements,
            bundle,
            transform,
            onComplete,
            transformExecutor);
    outstandingWork.incrementAndGet();
    transformExecutor.schedule(callable);
  }
コード例 #17
0
ファイル: Category.java プロジェクト: MikeBull94/rs-api
 @Override
 public String toString() {
   return MoreObjects.toStringHelper(this)
       .add("types", Arrays.toString(types))
       .add("alpha", Arrays.toString(alpha))
       .toString();
 }
コード例 #18
0
 public final String toString() {
   return MoreObjects.toStringHelper(this)
       .add("docID", docID())
       .add("responseSets", responseSets())
       .add("incomplete", incompleteResponses())
       .toString();
 }
コード例 #19
0
 @Override
 public String toString() {
   return MoreObjects.toStringHelper(UntargettedBinding.class)
       .add("key", getKey())
       .add("source", getSource())
       .toString();
 }
コード例 #20
0
ファイル: Intersect.java プロジェクト: zouxiaoliang/crate
 @Override
 public String toString() {
   return MoreObjects.toStringHelper(this)
       .add("relations", relations)
       .add("distinct", distinct)
       .toString();
 }
コード例 #21
0
 @Override
 public String toString() {
   return MoreObjects.toStringHelper("TestObject")
       .add("group", group)
       .add("item", item)
       .toString();
 }
コード例 #22
0
ファイル: Local.java プロジェクト: twilio/twilio-java
 @Override
 public String toString() {
   return MoreObjects.toStringHelper(this)
       .add("accountSid", accountSid)
       .add("addressRequirements", addressRequirements)
       .add("apiVersion", apiVersion)
       .add("beta", beta)
       .add("capabilities", capabilities)
       .add("dateCreated", dateCreated)
       .add("dateUpdated", dateUpdated)
       .add("friendlyName", friendlyName)
       .add("phoneNumber", phoneNumber)
       .add("sid", sid)
       .add("smsApplicationSid", smsApplicationSid)
       .add("smsFallbackMethod", smsFallbackMethod)
       .add("smsFallbackUrl", smsFallbackUrl)
       .add("smsMethod", smsMethod)
       .add("smsUrl", smsUrl)
       .add("statusCallback", statusCallback)
       .add("statusCallbackMethod", statusCallbackMethod)
       .add("trunkSid", trunkSid)
       .add("uri", uri)
       .add("voiceApplicationSid", voiceApplicationSid)
       .add("voiceCallerIdLookup", voiceCallerIdLookup)
       .add("voiceFallbackMethod", voiceFallbackMethod)
       .add("voiceFallbackUrl", voiceFallbackUrl)
       .add("voiceMethod", voiceMethod)
       .add("voiceUrl", voiceUrl)
       .toString();
 }
コード例 #23
0
 @Override
 public String toString() {
   return MoreObjects.toStringHelper(this)
       .add("currentTerm", currentTerm)
       .add("votedFor", votedFor)
       .toString();
 }
コード例 #24
0
ファイル: RtSimSolver.java プロジェクト: rinde/RinSim
 @Override
 public String toString() {
   return MoreObjects.toStringHelper(getClass())
       .add("schedule", schedule)
       .add("state", state)
       .toString();
 }
コード例 #25
0
 public long calculate(
     DefaultIssue issue, Collection<IssueChangeDto> debtChangelog, Period period) {
   if (issue.creationDate().getTime() > period.getSnapshotDate() + 1000L) {
     return MoreObjects.firstNonNull(issue.effortInMinutes(), 0L);
   }
   return calculateFromChangelog(issue, debtChangelog, period.getSnapshotDate());
 }
コード例 #26
0
 @Override
 public String toString() {
   return MoreObjects.toStringHelper(this)
       .add("tokens", tokens)
       .add("super", super.toString())
       .toString();
 }
コード例 #27
0
 @Override
 public String toString() {
   return MoreObjects.toStringHelper(this)
       .add("descripcion", descripcion)
       .add("valor", valor)
       .toString();
 }
コード例 #28
0
ファイル: TestSubmitRule.java プロジェクト: web1992/gerrit
  @Override
  public List<Record> apply(RevisionResource rsrc, Input input) throws AuthException, OrmException {
    if (input == null) {
      input = new Input();
    }
    if (input.rule != null && !rules.isProjectRulesEnabled()) {
      throw new AuthException("project rules are disabled");
    }
    input.filters = MoreObjects.firstNonNull(input.filters, filters);
    SubmitRuleEvaluator evaluator =
        new SubmitRuleEvaluator(changeDataFactory.create(db.get(), rsrc.getControl()));

    List<SubmitRecord> records =
        evaluator
            .setPatchSet(rsrc.getPatchSet())
            .setLogErrors(false)
            .setSkipSubmitFilters(input.filters == Filters.SKIP)
            .setRule(input.rule)
            .evaluate();
    List<Record> out = Lists.newArrayListWithCapacity(records.size());
    AccountLoader accounts = accountInfoFactory.create(true);
    for (SubmitRecord r : records) {
      out.add(new Record(r, accounts));
    }
    if (!out.isEmpty()) {
      out.get(0).prologReductionCount = evaluator.getReductionsConsumed();
    }
    accounts.fill();
    return out;
  }
コード例 #29
0
 @Override
 public String toString() {
   return MoreObjects.toStringHelper(this)
       .add("logTime", this.logTime)
       .add("logDesc", this.logDescription)
       .toString();
 }
コード例 #30
0
 @Override
 public String toString() {
   return MoreObjects.toStringHelper(getClass())
       .add("sender", sender)
       .add("totalEntries", digest.size())
       .toString();
 }