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

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew ArrayList()
  • Codota Iconnew LinkedList()
  • Smart code suggestions by Tabnine
}
origin: killbill/killbill

@Test(groups = "slow")
public void testCustomFieldNoId() throws Exception {
  // Verify that when coming from a plugin, the id isn't required
  final CustomField customField = Mockito.mock(CustomField.class);
  Mockito.when(customField.getObjectId()).thenReturn(accountId);
  Mockito.when(customField.getObjectType()).thenReturn(ObjectType.ACCOUNT);
  Mockito.when(customField.getFieldName()).thenReturn(UUID.randomUUID().toString());
  Mockito.when(customField.getFieldValue()).thenReturn(UUID.randomUUID().toString());
  eventsListener.pushExpectedEvents(NextEvent.CUSTOM_FIELD);
  customFieldUserApi.addCustomFields(ImmutableList.<CustomField>of(customField), callContext);
  assertListenerStatus();
}
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

Assert.assertEquals(all.get(0).getObjectType(), ObjectType.ACCOUNT);
Assert.assertEquals(all.get(0).getFieldName(), customField2.getFieldName());
Assert.assertEquals(all.get(0).getFieldValue(), customField2.getFieldValue());
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(customFields.size(), 1);
Assert.assertEquals(customFields.get(0).getFieldName(), customField.getFieldName());
Assert.assertEquals(customFields.get(0).getFieldValue(), customField.getFieldValue());
Assert.assertEquals(customFields.get(0).getObjectId(), customField.getObjectId());
Assert.assertEquals(customFields.get(0).getObjectType(), customField.getObjectType());
origin: stackoverflow.com

 import org.apache.lucene.document.Document;
import org.apache.lucene.facet.sortedset.SortedSetDocValuesFacetField;
import org.hibernate.search.bridge.FieldBridge;
import org.hibernate.search.bridge.LuceneOptions;

import java.io.IOException;

public class CustomFieldBridge implements FieldBridge {

  public void set(String name, Object value, Document document, LuceneOptions luceneOptions) {
    if (value != null) {
      CustomField customField = (CustomField) value;
      if (customField.getFieldValue() != null) {
        String fieldName = customField.getFieldName();
        String fieldValue = customField.getFieldValue();
        CustomFacetsConfig config = new CustomFacetsConfig();
        config.setIndexFieldName(fieldName, fieldName);
        Document doc = new Document();
        doc.add(new SortedSetDocValuesFacetField(fieldName, fieldValue));
        try {
          config.CustomBuild(doc, document);
        } catch (IOException e) {
          e.printStackTrace();
        }
      }
    }
  }
}
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

@Test(groups = "slow")
public void testCustomFieldNoId() throws Exception {
  // Verify that when coming from a plugin, the id isn't required
  final CustomField customField = Mockito.mock(CustomField.class);
  Mockito.when(customField.getObjectId()).thenReturn(accountId);
  Mockito.when(customField.getObjectType()).thenReturn(ObjectType.ACCOUNT);
  Mockito.when(customField.getFieldName()).thenReturn(UUID.randomUUID().toString());
  Mockito.when(customField.getFieldValue()).thenReturn(UUID.randomUUID().toString());
  eventsListener.pushExpectedEvents(NextEvent.CUSTOM_FIELD);
  customFieldUserApi.addCustomFields(ImmutableList.<CustomField>of(customField), callContext);
  assertListenerStatus();
}
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

Assert.assertEquals(all.get(0).getObjectType(), ObjectType.ACCOUNT);
Assert.assertEquals(all.get(0).getFieldName(), customField2.getFieldName());
Assert.assertEquals(all.get(0).getFieldValue(), customField2.getFieldValue());
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(customFields.size(), 1);
Assert.assertEquals(customFields.get(0).getFieldName(), customField.getFieldName());
Assert.assertEquals(customFields.get(0).getFieldValue(), customField.getFieldValue());
Assert.assertEquals(customFields.get(0).getObjectId(), customField.getObjectId());
Assert.assertEquals(customFields.get(0).getObjectType(), customField.getObjectType());
org.killbill.billing.util.customfieldCustomFieldgetFieldValue

Popular methods of CustomField

  • getFieldName
  • getId
  • getObjectId
  • getObjectType
  • updateValue

Popular in Java

  • Creating JSON documents from java classes using gson
  • setRequestProperty (URLConnection)
  • requestLocationUpdates (LocationManager)
  • getSharedPreferences (Context)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • JTextField (javax.swing)
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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