Tabnine Logo
SubscriptionJson.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.ning.billing.jaxrs.json.SubscriptionJson
constructor

Best Java code snippets using com.ning.billing.jaxrs.json.SubscriptionJson.<init> (Showing top 5 results out of 315)

origin: com.ning.billing/killbill-jaxrs

@GET
@Path("/{subscriptionId:" + UUID_PATTERN + "}")
@Produces(APPLICATION_JSON)
public Response getEntitlement(@PathParam("subscriptionId") final String subscriptionId,
                @javax.ws.rs.core.Context final HttpServletRequest request) throws SubscriptionApiException {
  final UUID uuid = UUID.fromString(subscriptionId);
  final Subscription subscription = subscriptionApi.getSubscriptionForEntitlementId(uuid, context.createContext(request));
  final SubscriptionJson json = new SubscriptionJson(subscription, null, null);
  return Response.status(Status.OK).entity(json).build();
}
origin: com.ning.billing/killbill-jaxrs

private BundleJson createBundleWithSubscriptions() {
  final String someUUID = UUID.randomUUID().toString();
  final UUID accountId = UUID.randomUUID();
  final UUID bundleId = UUID.randomUUID();
  final UUID subscriptionId = UUID.randomUUID();
  final String externalKey = UUID.randomUUID().toString();
  final SubscriptionJson entitlementJsonWithEvents = new SubscriptionJson(accountId.toString(), bundleId.toString(), subscriptionId.toString(), externalKey,
                                                new LocalDate(), someUUID, someUUID, someUUID, someUUID,
                                                new LocalDate(), new LocalDate(), new LocalDate(), new LocalDate(),
                                                null, null, null, null);
  return new BundleJson(accountId.toString(), bundleId.toString(), externalKey, ImmutableList.<SubscriptionJson>of(entitlementJsonWithEvents), null);
}
origin: com.ning.billing/killbill-jaxrs

public BundleJson(final SubscriptionBundle bundle, @Nullable final AccountAuditLogs accountAuditLogs) {
  super(toAuditLogJson(accountAuditLogs == null ? null : accountAuditLogs.getAuditLogsForBundle(bundle.getId())));
  this.accountId = bundle.getAccountId().toString();
  this.bundleId = bundle.getId().toString();
  this.externalKey = bundle.getExternalKey();
  this.subscriptions = new LinkedList<SubscriptionJson>();
  for (final Subscription cur : bundle.getSubscriptions()) {
    final ImmutableList<SubscriptionEvent> events = ImmutableList.<SubscriptionEvent>copyOf(Collections2.filter(bundle.getTimeline().getSubscriptionEvents(), new Predicate<SubscriptionEvent>() {
      @Override
      public boolean apply(@Nullable final SubscriptionEvent input) {
        return input.getEntitlementId().equals(cur.getId());
      }
    }));
    this.subscriptions.add(new SubscriptionJson(cur, events, accountAuditLogs));
  }
}
origin: com.ning.billing/killbill-jaxrs

  @Test(groups = "fast")
  public void testJson() throws Exception {

    final String someUUID = UUID.randomUUID().toString();
    final UUID bundleId = UUID.randomUUID();
    final String externalKey = UUID.randomUUID().toString();
    final List<AuditLogJson> auditLogs = createAuditLogsJson(clock.getUTCNow());

    EventSubscriptionJson event = new EventSubscriptionJson(someUUID, BillingPeriod.NO_BILLING_PERIOD.toString(), new LocalDate(), new LocalDate(), "product", "priceList", "eventType", "phase", null);
    final SubscriptionJson subscription = new SubscriptionJson(someUUID, someUUID, someUUID, externalKey,
                                            new LocalDate(), someUUID, someUUID, someUUID, someUUID, new LocalDate(), new LocalDate(),
                                            new LocalDate(), new LocalDate(),
                                            ImmutableList.<EventSubscriptionJson>of(event), null, null, auditLogs);

    final BundleJson bundleJson = new BundleJson(someUUID, bundleId.toString(), externalKey, ImmutableList.<SubscriptionJson>of(subscription), auditLogs);
    Assert.assertEquals(bundleJson.getBundleId(), bundleId.toString());
    Assert.assertEquals(bundleJson.getExternalKey(), externalKey);
    Assert.assertEquals(bundleJson.getSubscriptions().size(), 1);
    Assert.assertEquals(bundleJson.getAuditLogs(), auditLogs);

    final String asJson = mapper.writeValueAsString(bundleJson);
    final BundleJson fromJson = mapper.readValue(asJson, BundleJson.class);
    Assert.assertEquals(fromJson, bundleJson);
  }
}
origin: com.ning.billing/killbill-jaxrs

                                                                PhaseType.DISCOUNT.toString(),
                                                                auditLogs);
final SubscriptionJson entitlementJsonWithEvents = new SubscriptionJson(accountId, bundleId, subscriptionId, externalKey,
                                              new LocalDate(), someUUID, someUUID, someUUID, someUUID,
                                              new LocalDate(), new LocalDate(), new LocalDate(), new LocalDate(),
com.ning.billing.jaxrs.jsonSubscriptionJson<init>

Popular methods of SubscriptionJson

  • getAccountId
  • getBillingPeriod
  • getBundleId
  • getExternalKey
  • getPriceList
  • getProductCategory
  • getProductName
  • toAuditLogJson

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setRequestProperty (URLConnection)
  • runOnUiThread (Activity)
  • onCreateOptionsMenu (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JButton (javax.swing)
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now