Codota Logo
Jsons.p
Code IndexAdd Codota to your IDE (free)

How to use
p
method
in
org.opencastproject.util.Jsons

Best Java code snippets using org.opencastproject.util.Jsons.p (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
origin: opencast/opencast

 public Obj toJson() {
  return Jsons.obj(Jsons.p("address", address), Jsons.p("name", name));
 }
}
origin: opencast/opencast

public static String generateErrorResponse(ErrorCodeException e) {
 Obj json = obj(p("error", obj(p("code", e.getErrorCode()), p("message", StringUtils.trimToEmpty(e.getMessage())))));
 return json.toJson();
}
origin: opencast/opencast

 @Override
 public Jsons.Obj apply(BundleVersion version) {
  return obj(p("version", version.getBundleVersion()), p("buildNumber", version.getBuildNumber().map(stringVal)));
 }
};
origin: opencast/opencast

public static Jsons.Obj bundleInfoJson(BundleInfo bundle) {
 return obj(p("host", bundle.getHost()), p("bundleSymbolicName", bundle.getBundleSymbolicName()),
     p("bundleId", bundle.getBundleId())).append(fullVersionJson.apply(bundle.getVersion()));
}
origin: opencast/opencast

/** Constructor method. */
public static IncidentDto mk(
    Long jobId,
    Date date,
    String code,
    Severity severity,
    Map<String, String> parameters,
    List<Tuple<String, String>> details) {
 IncidentDto dto = new IncidentDto();
 dto.jobId = jobId;
 dto.timestamp = date;
 dto.code = code;
 dto.severity = severity.ordinal();
 List<Prop> props = new ArrayList<Jsons.Prop>();
 for (Entry<String, String> entry : parameters.entrySet()) {
  props.add(p(entry.getKey(), entry.getValue()));
 }
 dto.parameters = obj(props.toArray(new Prop[props.size()])).toJson();
 props = new ArrayList<Jsons.Prop>();
 for (Tuple<String, String> t : details) {
  props.add(p(t.getA(), t.getB()));
 }
 dto.details = obj(props.toArray(new Prop[props.size()])).toJson();
 return dto;
}
origin: opencast/opencast

@GET
// path prefix "bundles" is contained here and not in the path annotation of the class
// See https://opencast.jira.com/browse/MH-9768
@Path("bundles/list")
@Produces(APPLICATION_JSON)
@RestQuery(
 name = "list",
 description = "Return a list of all running bundles on the whole cluster.",
 reponses = {
  @RestResponse(description = "A list of bundles.", responseCode = HttpServletResponse.SC_OK) },
 returnDescription = "The search results, expressed as xml or json.")
public Response getVersions() {
 final Monadics.ListMonadic<Jsons.Val> bundleInfos = mlist(getDb().getBundles()).map(
     Functions.<BundleInfo, Jsons.Val> co(bundleInfo));
 return ok(obj(p("bundleInfos", arr(bundleInfos)), p("count", bundleInfos.value().size())));
}
origin: opencast/opencast

 @Override
 public Response apply(List<BundleInfo> infos) {
  final Set<BundleVersion> versions = set();
  for (BundleInfo bundle : infos) {
   versions.add(bundle.getVersion());
  }
  final BundleInfo example = infos.get(0);
  switch (versions.size()) {
   case 0:
    // no versions...
    throw new Error("bug");
   case 1:
    // all versions align
    return ok(obj(p("consistent", true)).append(fullVersionJson.apply(example.getVersion())));
   default:
    // multiple versions found
    return ok(obj(p("consistent", false),
           p("versions",
            arr(mlist(versions.iterator())
                .map(Functions.<BundleVersion, Jsons.Val> co(fullVersionJson))))));
  }
 }
});
org.opencastproject.utilJsonsp

Javadoc

Create a property. Convenience.

Popular methods of Jsons

  • obj
    Create an object.
  • arr
    Create an array.
  • toJson
  • toJsonSimple
  • v

Popular in Java

  • Start an intent from android
  • getApplicationContext (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • addToBackStack (FragmentTransaction)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • BoxLayout (javax.swing)
  • LogFactory (org.apache.commons.logging)
    A minimal incarnation of Apache Commons Logging's LogFactory API, providing just the common Log look
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now