Tabnine Logo
CustomField.getId
Code IndexAdd Tabnine to your IDE (free)

How to use
getId
method
in
org.killbill.billing.util.customfield.CustomField

Best Java code snippets using org.killbill.billing.util.customfield.CustomField.getId (Showing top 16 results out of 315)

origin: killbill/killbill

  @Override
  public UUID apply(final CustomField input) {
    return input.getId();
  }
});
origin: killbill/killbill

  @Override
  public CustomFieldModelDao apply(final CustomField input) {
    // Respect user-specified ID
    // TODO See https://github.com/killbill/killbill/issues/35
    if (input.getId() != null) {
      return new CustomFieldModelDao(input.getId(), context.getCreatedDate(), context.getCreatedDate(), input.getFieldName(), input.getFieldValue(), input.getObjectId(), input.getObjectType());
    } else {
      return new CustomFieldModelDao(context.getCreatedDate(), input.getFieldName(), input.getFieldValue(), input.getObjectId(), input.getObjectType());
    }
  }
});
origin: killbill/killbill

  @Override
  public CustomFieldModelDao apply(final CustomField input) {
    return new CustomFieldModelDao(input.getId(), internalCallContext.getCreatedDate(), internalCallContext.getUpdatedDate(), input.getFieldName(), input.getFieldValue(), input.getObjectId(), input.getObjectType());
  }
});
origin: killbill/killbill

@Test(groups = "slow")
public void testCustomFieldUpdate() throws Exception {
  final CustomField customField1 = new StringCustomField("gtqre", "value1", ObjectType.ACCOUNT, accountId, callContext.getCreatedDate());
  eventsListener.pushExpectedEvents(NextEvent.CUSTOM_FIELD);
  customFieldUserApi.addCustomFields(ImmutableList.<CustomField>of(customField1), callContext);
  assertListenerStatus();
  final CustomField update1 = new StringCustomField(customField1.getId(), customField1.getFieldName(), "value2", customField1.getObjectType(), customField1.getObjectId(), callContext.getCreatedDate());
  customFieldUserApi.updateCustomFields(ImmutableList.of(update1), callContext);
  List<CustomField> all = customFieldUserApi.getCustomFieldsForAccount(accountId, callContext);
  Assert.assertEquals(all.size(), 1);
  Assert.assertEquals(all.get(0).getId(), update1.getId());
  Assert.assertEquals(all.get(0).getObjectType(), update1.getObjectType());
  Assert.assertEquals(all.get(0).getObjectId(), update1.getObjectId());
  Assert.assertEquals(all.get(0).getFieldName(), update1.getFieldName());
  Assert.assertEquals(all.get(0).getFieldValue(), "value2");
  try {
    customFieldUserApi.updateCustomFields(ImmutableList.<CustomField>of(new StringCustomField("gtqre", "value1", ObjectType.ACCOUNT, accountId, callContext.getCreatedDate())), callContext);
    Assert.fail("Updating custom field should fail");
  } catch (final CustomFieldApiException e) {
    Assert.assertEquals(e.getCode(), ErrorCode.CUSTOM_FIELD_DOES_NOT_EXISTS_FOR_ID.getCode());
  }
  try {
    customFieldUserApi.updateCustomFields(ImmutableList.<CustomField>of(new StringCustomField(customField1.getId(), "wrongName", "value2", customField1.getObjectType(), customField1.getObjectId(), callContext.getCreatedDate())), callContext);
    Assert.fail("Updating custom field should fail");
  } catch (final CustomFieldApiException e) {
    Assert.assertEquals(e.getCode(), ErrorCode.CUSTOM_FIELD_INVALID_UPDATE.getCode());
  }
}
origin: killbill/killbill

Assert.assertEquals(all.get(0).getId(), customField2.getId());
Assert.assertEquals(all.get(0).getObjectId(), accountId);
Assert.assertEquals(all.get(0).getObjectType(), ObjectType.ACCOUNT);
origin: stackoverflow.com

 private void saveValue(MutableIssue issue, String valueToSave, CustomField
    customField) throws FieldLayoutStorageException {

  issue.setCustomFieldValue(customField, valueToSave);

  Map<String, ModifiedValue> modifiedFields = issue.getModifiedFields();

  FieldLayoutItem fieldLayoutItem =
  ComponentManager.getInstance().getFieldLayoutManager().getFieldLayout(issue).getFieldLayoutItem(
      customField);

  DefaultIssueChangeHolder issueChangeHolder = new DefaultIssueChangeHolder();

  final ModifiedValue modifiedValue = (ModifiedValue) modifiedFields.get(customField.getId());

  customField.updateValue(fieldLayoutItem, issue, modifiedValue, issueChangeHolder);
}
origin: org.kill-bill.billing/killbill-util

  @Override
  public UUID apply(final CustomField input) {
    return input.getId();
  }
});
origin: org.kill-bill.billing/killbill-jaxrs

  @Override
  public boolean apply(final CustomField input) {
    if (customFieldList.isEmpty()) {
      return true;
    }
    for (final UUID curId : customFieldList) {
      if (input.getId().equals(curId)) {
        return true;
      }
    }
    return false;
  }
});
origin: org.kill-bill.billing/killbill-jaxrs

protected Response createCustomFieldResponse(final Iterable<CustomField> fields, final AuditMode auditMode, final TenantContext context) {
  final Collection<CustomFieldJson> result = new LinkedList<CustomFieldJson>();
  for (final CustomField cur : fields) {
    // TODO PIERRE - Bulk API
    final List<AuditLog> auditLogs = auditUserApi.getAuditLogs(cur.getId(), ObjectType.CUSTOM_FIELD, auditMode.getLevel(), context);
    result.add(new CustomFieldJson(cur, auditLogs));
  }
  return Response.status(Response.Status.OK).entity(result).build();
}
origin: org.kill-bill.billing/killbill-jaxrs

  @Override
  public CustomFieldJson apply(final CustomField customField) {
    // TODO Really slow - we should instead try to figure out the account id
    final List<AuditLog> auditLogs = auditUserApi.getAuditLogs(customField.getId(), ObjectType.CUSTOM_FIELD, auditMode.getLevel(), tenantContext);
    return new CustomFieldJson(customField, auditLogs);
  }
},
origin: org.kill-bill.billing/killbill-jaxrs

  @Override
  public CustomFieldJson apply(final CustomField customField) {
    // TODO Really slow - we should instead try to figure out the account id
    final List<AuditLog> auditLogs = auditUserApi.getAuditLogs(customField.getId(), ObjectType.CUSTOM_FIELD, auditMode.getLevel(), tenantContext);
    return new CustomFieldJson(customField, auditLogs);
  }
},
origin: org.kill-bill.billing/killbill-jaxrs

public CustomFieldJson(final CustomField input, @Nullable final List<AuditLog> auditLogs) {
  this(input.getId(), input.getObjectId(), input.getObjectType(), input.getFieldName(), input.getFieldValue(), toAuditLogJson(auditLogs));
}
origin: org.kill-bill.billing/killbill-util

  @Override
  public CustomFieldModelDao apply(final CustomField input) {
    // Respect user-specified ID
    // TODO See https://github.com/killbill/killbill/issues/35
    if (input.getId() != null) {
      return new CustomFieldModelDao(input.getId(), context.getCreatedDate(), context.getCreatedDate(), input.getFieldName(), input.getFieldValue(), input.getObjectId(), input.getObjectType());
    } else {
      return new CustomFieldModelDao(context.getCreatedDate(), input.getFieldName(), input.getFieldValue(), input.getObjectId(), input.getObjectType());
    }
  }
});
origin: org.kill-bill.billing/killbill-util

  @Override
  public CustomFieldModelDao apply(final CustomField input) {
    return new CustomFieldModelDao(input.getId(), internalCallContext.getCreatedDate(), internalCallContext.getUpdatedDate(), input.getFieldName(), input.getFieldValue(), input.getObjectId(), input.getObjectType());
  }
});
origin: org.kill-bill.billing/killbill-util

@Test(groups = "slow")
public void testCustomFieldUpdate() throws Exception {
  final CustomField customField1 = new StringCustomField("gtqre", "value1", ObjectType.ACCOUNT, accountId, callContext.getCreatedDate());
  eventsListener.pushExpectedEvents(NextEvent.CUSTOM_FIELD);
  customFieldUserApi.addCustomFields(ImmutableList.<CustomField>of(customField1), callContext);
  assertListenerStatus();
  final CustomField update1 = new StringCustomField(customField1.getId(), customField1.getFieldName(), "value2", customField1.getObjectType(), customField1.getObjectId(), callContext.getCreatedDate());
  customFieldUserApi.updateCustomFields(ImmutableList.of(update1), callContext);
  List<CustomField> all = customFieldUserApi.getCustomFieldsForAccount(accountId, callContext);
  Assert.assertEquals(all.size(), 1);
  Assert.assertEquals(all.get(0).getId(), update1.getId());
  Assert.assertEquals(all.get(0).getObjectType(), update1.getObjectType());
  Assert.assertEquals(all.get(0).getObjectId(), update1.getObjectId());
  Assert.assertEquals(all.get(0).getFieldName(), update1.getFieldName());
  Assert.assertEquals(all.get(0).getFieldValue(), "value2");
  try {
    customFieldUserApi.updateCustomFields(ImmutableList.<CustomField>of(new StringCustomField("gtqre", "value1", ObjectType.ACCOUNT, accountId, callContext.getCreatedDate())), callContext);
    Assert.fail("Updating custom field should fail");
  } catch (final CustomFieldApiException e) {
    Assert.assertEquals(e.getCode(), ErrorCode.CUSTOM_FIELD_DOES_NOT_EXISTS_FOR_ID.getCode());
  }
  try {
    customFieldUserApi.updateCustomFields(ImmutableList.<CustomField>of(new StringCustomField(customField1.getId(), "wrongName", "value2", customField1.getObjectType(), customField1.getObjectId(), callContext.getCreatedDate())), callContext);
    Assert.fail("Updating custom field should fail");
  } catch (final CustomFieldApiException e) {
    Assert.assertEquals(e.getCode(), ErrorCode.CUSTOM_FIELD_INVALID_UPDATE.getCode());
  }
}
origin: org.kill-bill.billing/killbill-util

Assert.assertEquals(all.get(0).getId(), customField2.getId());
Assert.assertEquals(all.get(0).getObjectId(), accountId);
Assert.assertEquals(all.get(0).getObjectType(), ObjectType.ACCOUNT);
org.killbill.billing.util.customfieldCustomFieldgetId

Popular methods of CustomField

  • getFieldName
  • getFieldValue
  • getObjectId
  • getObjectType
  • updateValue

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setScale (BigDecimal)
  • onRequestPermissionsResult (Fragment)
  • getContentResolver (Context)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • JComboBox (javax.swing)
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Top PhpStorm plugins
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