congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
BundleJson
Code IndexAdd Tabnine to your IDE (free)

How to use
BundleJson
in
com.ning.billing.jaxrs.json

Best Java code snippets using com.ning.billing.jaxrs.json.BundleJson (Showing top 12 results out of 315)

origin: com.ning.billing/killbill-jaxrs

  @Override
  public BundleJson apply(final SubscriptionBundle input) {
    return new BundleJson(input, null);
  }
});
origin: com.ning.billing/killbill-jaxrs

@Override
public boolean equals(final Object o) {
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  final BundleTimelineJson that = (BundleTimelineJson) o;
  if (bundle != null ? !bundle.equals(that.bundle) : that.bundle != null) {
    return false;
  }
  if (invoices != null ? !invoices.equals(that.invoices) : that.invoices != null) {
    return false;
  }
  if (payments != null ? !payments.equals(that.payments) : that.payments != null) {
    return false;
  }
  if (reasonForChange != null ? !reasonForChange.equals(that.reasonForChange) : that.reasonForChange != null) {
    return false;
  }
  if (viewId != null ? !viewId.equals(that.viewId) : that.viewId != null) {
    return false;
  }
  return true;
}
origin: com.ning.billing/killbill-jaxrs

  @Override
  public int hashCode() {
    int result = viewId != null ? viewId.hashCode() : 0;
    result = 31 * result + (bundle != null ? bundle.hashCode() : 0);
    result = 31 * result + (payments != null ? payments.hashCode() : 0);
    result = 31 * result + (invoices != null ? invoices.hashCode() : 0);
    result = 31 * result + (reasonForChange != null ? reasonForChange.hashCode() : 0);
    return result;
  }
}
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

@PUT
@Path("/{bundleId:" + UUID_PATTERN + "}")
@Consumes(APPLICATION_JSON)
@Produces(APPLICATION_JSON)
public Response transferBundle(final BundleJson json,
                @PathParam(ID_PARAM_NAME) final String id,
                @QueryParam(QUERY_REQUESTED_DT) final String requestedDate,
                @QueryParam(QUERY_BILLING_POLICY) @DefaultValue("END_OF_TERM") final String policyString,
                @HeaderParam(HDR_CREATED_BY) final String createdBy,
                @HeaderParam(HDR_REASON) final String reason,
                @HeaderParam(HDR_COMMENT) final String comment,
                @javax.ws.rs.core.Context final UriInfo uriInfo,
                @javax.ws.rs.core.Context final HttpServletRequest request) throws EntitlementApiException, SubscriptionApiException, AccountApiException {
  final BillingActionPolicy policy = BillingActionPolicy.valueOf(policyString.toUpperCase());
  final CallContext callContext = context.createContext(createdBy, reason, comment, request);
  final UUID bundleId = UUID.fromString(id);
  final SubscriptionBundle bundle = subscriptionApi.getSubscriptionBundle(bundleId, callContext);
  final LocalDate inputLocalDate = toLocalDate(bundle.getAccountId(), requestedDate, callContext);
  final UUID newBundleId = entitlementApi.transferEntitlementsOverrideBillingPolicy(bundle.getAccountId(), UUID.fromString(json.getAccountId()), bundle.getExternalKey(), inputLocalDate, policy, callContext);
  return uriBuilder.buildResponse(BundleResource.class, "getBundle", newBundleId, uriInfo.getBaseUri().toString());
}
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

@GET
@Path("/{bundleId:" + UUID_PATTERN + "}")
@Produces(APPLICATION_JSON)
public Response getBundle(@PathParam("bundleId") final String bundleId,
             @javax.ws.rs.core.Context final HttpServletRequest request) throws SubscriptionApiException {
  final UUID id = UUID.fromString(bundleId);
  final SubscriptionBundle bundle = subscriptionApi.getSubscriptionBundle(id, context.createContext(request));
  final BundleJson json = new BundleJson(bundle, null);
  return Response.status(Status.OK).entity(json).build();
}
origin: com.ning.billing/killbill-jaxrs

@GET
@Produces(APPLICATION_JSON)
public Response getBundleByKey(@QueryParam(QUERY_EXTERNAL_KEY) final String externalKey,
                @javax.ws.rs.core.Context final HttpServletRequest request) throws SubscriptionApiException {
  final SubscriptionBundle bundle = subscriptionApi.getActiveSubscriptionBundleForExternalKey(externalKey, context.createContext(request));
  final BundleJson json = new BundleJson(bundle, null);
  return Response.status(Status.OK).entity(json).build();
}
origin: com.ning.billing/killbill-jaxrs

  @Override
  public BundleJson apply(final SubscriptionBundle bundle) {
    // Cache audit logs per account
    if (accountsAuditLogs.get().get(bundle.getAccountId()) == null) {
      accountsAuditLogs.get().put(bundle.getAccountId(), auditUserApi.getAccountAuditLogs(bundle.getAccountId(), auditMode.getLevel(), tenantContext));
    }
    return new BundleJson(bundle, accountsAuditLogs.get().get(bundle.getAccountId()));
  }
},
origin: com.ning.billing/killbill-jaxrs

  @Override
  public BundleJson apply(final SubscriptionBundle bundle) {
    // Cache audit logs per account
    if (accountsAuditLogs.get().get(bundle.getAccountId()) == null) {
      accountsAuditLogs.get().put(bundle.getAccountId(), auditUserApi.getAccountAuditLogs(bundle.getAccountId(), auditMode.getLevel(), tenantContext));
    }
    return new BundleJson(bundle, accountsAuditLogs.get().get(bundle.getAccountId()));
  }
},
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

for (final SubscriptionBundle bundle : bundles) {
  final List<AuditLog> bundleAuditLogs = accountAuditLogs.getAuditLogsForBundle(bundle.getId());
  final BundleJson jsonWithSubscriptions = new BundleJson(bundle, accountAuditLogs);
  this.bundles.add(jsonWithSubscriptions);
com.ning.billing.jaxrs.jsonBundleJson

Most used methods

  • <init>
  • equals
  • getAccountId
  • getAuditLogs
  • getBundleId
  • getExternalKey
  • getSubscriptions
  • hashCode
  • toAuditLogJson

Popular in Java

  • Reactive rest calls using spring rest template
  • onCreateOptionsMenu (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • findViewById (Activity)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • 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