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

How to use
DynamicListProperty
in
com.netflix.config

Best Java code snippets using com.netflix.config.DynamicListProperty (Showing top 20 results out of 315)

origin: rancher/cattle

@Override
public List<String> getNamedMaps() {
  return KEYS.get();
}
origin: com.netflix.archaius/archaius-core

private void propertyChangedInternal() {
  load();
  propertyChanged();
}
origin: com.netflix.archaius/archaius-core

/**
 * Create the dynamic list property. The guava Splitter used is created as
 * <code>Splitter.onPattern(delimiterRegex).omitEmptyStrings().trimResults()</code>. The default
 * list value will be taken from the passed in list argument.
 */
public DynamicListProperty(String propName, List<T> defaultValue, String delimiterRegex) {
  setup(propName, defaultValue, delimiterRegex);
}
origin: com.netflix.archaius/archaius-core

/**
 * Create the dynamic list property. The guava Splitter used is created as
 * <code>Splitter.onPattern(delimiterRegex).omitEmptyStrings().trimResults()</code>. The default
 * list value will be transformed from list of strings after splitting. If defaultValue string is
 * null, the default list value will be an empty list.
 */
public DynamicListProperty(String propName, String defaultValue, String delimiterRegex) {
  this.splitter = Splitter.onPattern(delimiterRegex).omitEmptyStrings().trimResults();
  setup(propName, transform(split(defaultValue)), splitter);
}
origin: com.netflix.archaius/archaius-core

protected void load() {
  if (delegate.get() == null) {
    values = defaultValues;
  } else {
    values = transform(split(delegate.get()));
  }
}
origin: com.netflix.archaius/archaius-core

protected List<T> transform(List<String> stringValues) {
  List<T> list = new ArrayList<T>(stringValues.size());
  for (String s : stringValues) {
    list.add(from(s));
  }
  return Collections.unmodifiableList(list);    
}

origin: com.netflix.archaius/archaius-core

private void setup(String propName, List<T> defaultValue, Splitter splitter) {
  // Make a defensive copy of the default value. Would prefer to use an ImmutableList, but that
  // does not allow for null values in the List.
  this.defaultValues = (defaultValue == null ? null : 
    Collections.unmodifiableList(new ArrayList<T>(defaultValue)));
  
  this.splitter = splitter;
  delegate = DynamicPropertyFactory.getInstance().getStringProperty(propName, null);
  load();
  Runnable callback = new Runnable() {
    @Override
    public void run() {
      propertyChangedInternal();
    }
  };
  delegate.addCallback(callback);
}
origin: com.netflix.archaius/archaius-legacy

/**
 * Create the dynamic list property. The guava Splitter used is created as
 * <code>Splitter.onPattern(delimiterRegex).omitEmptyStrings().trimResults()</code>. The default
 * list value will be transformed from list of strings after splitting. If defaultValue string is
 * null, the default list value will be an empty list.
 */
public DynamicListProperty(String propName, String defaultValue, String delimiterRegex) {
  this.splitter = Splitter.onPattern(delimiterRegex).omitEmptyStrings().trimResults();
  setup(propName, transform(split(defaultValue)), splitter);
}
origin: com.netflix.archaius/archaius-legacy

protected void load() {
  if (delegate.get() == null) {
    values = defaultValues;
  } else {
    values = transform(split(delegate.get()));
  }
}
origin: com.netflix.archaius/archaius-legacy

protected List<T> transform(List<String> stringValues) {
  List<T> list = new ArrayList<T>(stringValues.size());
  for (String s : stringValues) {
    list.add(from(s));
  }
  return Collections.unmodifiableList(list);    
}

origin: com.netflix.archaius/archaius-legacy

private void setup(String propName, List<T> defaultValue, Splitter splitter) {
  // Make a defensive copy of the default value. Would prefer to use an ImmutableList, but that
  // does not allow for null values in the List.
  this.defaultValues = (defaultValue == null ? null : 
    Collections.unmodifiableList(new ArrayList<T>(defaultValue)));
  
  this.splitter = splitter;
  delegate = DynamicPropertyFactory.getInstance().getStringProperty(propName, null);
  load();
  Runnable callback = new Runnable() {
    @Override
    public void run() {
      propertyChangedInternal();
    }
  };
  delegate.addCallback(callback);
}
origin: com.netflix.archaius/archaius-legacy

@Override
public List<T> getValue() {
  return get();
}

origin: com.netflix.archaius/archaius-legacy

private void propertyChangedInternal() {
  load();
  propertyChanged();
}
origin: com.netflix.archaius/archaius-legacy

/**
 * Create the dynamic list property using the splitter and default list value passed in 
 * from the arguments.
 */
public DynamicListProperty(String propName, List<T> defaultValue, Splitter splitter) {
  setup(propName, defaultValue, splitter);
}
origin: com.netflix.archaius/archaius-core

@Override
public List<T> getValue() {
  return get();
}

origin: com.netflix.archaius/archaius-core

/**
 * Create the dynamic list property using the splitter and default list value passed in 
 * from the arguments.
 */
public DynamicListProperty(String propName, List<T> defaultValue, Splitter splitter) {
  setup(propName, defaultValue, splitter);
}
origin: com.xorlev.gatekeeper/gatekeeper-core

public static List<String> getStringList(String property) {
  final DynamicListProperty<String> listProperty = new DynamicStringListProperty(property, "");
  return listProperty.get();
}
origin: com.netflix.archaius/archaius-legacy

/**
 * Create the dynamic list property. The guava Splitter used is created as
 * <code>Splitter.onPattern(delimiterRegex).omitEmptyStrings().trimResults()</code>. The default
 * list value will be taken from the passed in list argument.
 */
public DynamicListProperty(String propName, List<T> defaultValue, String delimiterRegex) {
  setup(propName, defaultValue, delimiterRegex);
}
origin: rancher/cattle

@Override
protected void populateContext(Agent agent, Instance instance, ConfigItem item, ArchiveContext context) {
  context.getData().put("data", map.getMap(name));
  if (instance != null) {
    return;
  }
  Client client = new Client(Agent.class, agent.getId());
  ConfigUpdateRequest request = new ConfigUpdateRequest(client).withDeferredTrigger(true);
  for (String itemName : REQUIRED.get()) {
    if (!statusManager.isAssigned(client, itemName)) {
      log.info("Adding missing [{}] to agent [{}]", itemName, agent.getId());
      request.addItem(itemName);
    }
  }
  if (request.getItems().size() > 0) {
    statusManager.updateConfig(request);
  }
}
origin: com.netflix.archaius/archaius-legacy

private void setup(String propName, List<T> defaultValue, String delimiterRegex) {
  setup(propName, defaultValue, Splitter.onPattern(delimiterRegex).omitEmptyStrings().trimResults());
}
com.netflix.configDynamicListProperty

Javadoc

This class delegates to a regex (default is comma) delimited dynamic string property and returns a dynamic list of a generic type which is transformed from string.

Most used methods

  • get
    Get the list type from the underlying dynamic string property. If the property is undefined, this me
  • from
    Construct the generic type from string.
  • load
  • propertyChanged
    A method invoked when the underlying string property is changed. Default implementation does nothing
  • setup
  • split
  • transform

Popular in Java

  • Start an intent from android
  • onCreateOptionsMenu (Activity)
  • getResourceAsStream (ClassLoader)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • From CI to AI: The AI layer in your organization
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