Tabnine Logo
ReflectUtils
Code IndexAdd Tabnine to your IDE (free)

How to use
ReflectUtils
in
org.crazyyak.dev.common

Best Java code snippets using org.crazyyak.dev.common.ReflectUtils (Showing top 7 results out of 315)

origin: org.crazyyak.dev/yak-dev-jersey-spring

 protected String[] getSpringProfiles(ServletContext servletContext, WebApplicationContext appContext) {

  String environmentName = System.getProperty(getEnvironmentPropertyName(servletContext, appContext), "null");
  String envProfileName = "env-"+environmentName;
  String defaultProfiles = StringUtils.toDelineatedString(",", "main", "live", envProfileName);

  String profilesString = System.getProperty(getProfilesPropertyName(servletContext, appContext), defaultProfiles);
  List<String> profiles = new ArrayList<>();

  for (String profile : profilesString.split(",")) {
   profiles.add(profile.trim());
  }

  return ReflectUtils.toArray(String.class, profiles);
 }
}
origin: org.crazyyak.dev/yak-dev-couchace

protected void injectVersion(T entity, WriteResponse response) {
 String version = response.getDocumentRevision();
 EntityMeta<T> meta = new AnnotationMetaBuilder().buildEntityMeta(entityType);
 String property = meta.getRevisionName();
 Field field = ReflectUtils.getField(entity.getClass(), property);
 ReflectUtils.setPropertyValue(entity, field, version);
}
origin: com.cosmicpush/push-server-engine

@JsonCreator
private NotificationPushV1(@JsonProperty("message") String message,
              @JsonProperty("callbackUrl") String callbackUrl,
              @JsonProperty("remoteHost") String remoteHost,
              @JsonProperty("remoteAddress") String remoteAddress,
              @JsonProperty("traits") Map<String, String> traits) {
 this.message = (message == null) ? "No message" : message.trim();
 this.remoteHost = remoteHost;
 this.remoteAddress = remoteAddress;
 this.callbackUrl = callbackUrl;
 // Get a list of all the keys so that we can loop on the map
 // and remove anything without an actual value (purge nulls).
 if (traits != null) {
  this.traits.putAll(traits);
 }
 String[] keys = ReflectUtils.toArray(String.class, this.traits.keySet());
 for (String key : keys) {
  if (StringUtils.isBlank(this.traits.get(key))) {
   this.traits.remove(key);
  }
 }
}
origin: com.cosmicpush/push-server-pub

String[] keys = ReflectUtils.toArray(String.class, this.traits.keySet());
origin: com.cosmicpush/push-server-pub

private SmtpEmailPush(@JsonProperty("toAddress") String toAddress,
            @JsonProperty("fromAddress") String fromAddress,
            @JsonProperty("emailSubject") String emailSubject,
            @JsonProperty("htmlContent") String htmlContent,
            @JsonProperty("callbackUrl") String callbackUrl,
            @JsonProperty("remoteHost") String remoteHost,
            @JsonProperty("remoteAddress") String remoteAddress,
            @JsonProperty("traits") Map<String, String> traits) {
 this.toAddress =   toAddress;
 this.fromAddress = fromAddress;
 this.emailSubject = emailSubject;
 String content = StringUtils.getTagContents(htmlContent, "body", 0);
 this.htmlContent = StringUtils.isNotBlank(content) ? content : htmlContent;
 this.callbackUrl = callbackUrl;
 this.remoteHost = remoteHost;
 this.remoteAddress = remoteAddress;
 // Get a list of all the keys so that we can loop on the map
 // and remove anything without an actual value (purge nulls).
 if (traits != null) {
  this.traits.putAll(traits);
 }
 String[] keys = ReflectUtils.toArray(String.class, this.traits.keySet());
 for (String key : keys) {
  if (StringUtils.isBlank(this.traits.get(key))) {
   this.traits.remove(key);
  }
 }
}
origin: com.cosmicpush/push-server-pub

protected EmailPush(@JsonProperty("toAddress") String toAddress,
          @JsonProperty("fromAddress") String fromAddress,
          @JsonProperty("emailSubject") String emailSubject,
          @JsonProperty("htmlContent") String htmlContent,
          @JsonProperty("callbackUrl") String callbackUrl,
          @JsonProperty("remoteHost") String remoteHost,
          @JsonProperty("remoteAddress") String remoteAddress,
          @JsonProperty("traits") Map<String, String> traits) {
 this.toAddress =   toAddress;
 this.fromAddress = fromAddress;
 this.emailSubject = emailSubject;
 String content = StringUtils.getTagContents(htmlContent, "body", 0);
 this.htmlContent = StringUtils.isNotBlank(content) ? content : htmlContent;
 this.callbackUrl = callbackUrl;
 this.remoteHost = remoteHost;
 this.remoteAddress = remoteAddress;
 // Get a list of all the keys so that we can loop on the map
 // and remove anything without an actual value (purge nulls).
 if (traits != null) {
  this.traits.putAll(traits);
 }
 String[] keys = ReflectUtils.toArray(String.class, this.traits.keySet());
 for (String key : keys) {
  if (StringUtils.isBlank(this.traits.get(key))) {
   this.traits.remove(key);
  }
 }
}
origin: com.cosmicpush/push-server-pub

private SesEmailPush(@JsonProperty("toAddress") String toAddress,
           @JsonProperty("fromAddress") String fromAddress,
           @JsonProperty("emailSubject") String emailSubject,
           @JsonProperty("htmlContent") String htmlContent,
           @JsonProperty("callbackUrl") String callbackUrl,
           @JsonProperty("remoteHost") String remoteHost,
           @JsonProperty("remoteAddress") String remoteAddress,
           @JsonProperty("traits") Map<String, String> traits) {
 this.toAddress =   toAddress;
 this.fromAddress = fromAddress;
 this.emailSubject = emailSubject;
 String content = StringUtils.getTagContents(htmlContent, "body", 0);
 this.htmlContent = StringUtils.isNotBlank(content) ? content : htmlContent;
 this.callbackUrl = callbackUrl;
 this.remoteHost = remoteHost;
 this.remoteAddress = remoteAddress;
 // Get a list of all the keys so that we can loop on the map
 // and remove anything without an actual value (purge nulls).
 if (traits != null) {
  this.traits.putAll(traits);
 }
 String[] keys = ReflectUtils.toArray(String.class, this.traits.keySet());
 for (String key : keys) {
  if (StringUtils.isBlank(this.traits.get(key))) {
   this.traits.remove(key);
  }
 }
}
org.crazyyak.dev.commonReflectUtils

Most used methods

  • toArray
  • getField
  • setPropertyValue

Popular in Java

  • Reactive rest calls using spring rest template
  • getSharedPreferences (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • compareTo (BigDecimal)
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • JList (javax.swing)
  • Best plugins for Eclipse
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