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

How to use
Sample
in
org.opennms.newts.api

Best Java code snippets using org.opennms.newts.api.Sample (Showing top 20 results out of 315)

origin: stackoverflow.com

 public static final Sample ValueB = new Sample() {
  @Override
  public String getValue(){ return "B"; }

  public void doSomething(){ }
};
origin: OpenNMS/newts

@Override
public String toString() {
  return String.format(
      "%s[timestamp=%s, context=%s, resource=%s, name=%s, type=%s, value=%s]",
      getClass().getSimpleName(),
      getTimestamp(),
      getContext(),
      getResource(),
      getName(),
      getType(),
      getValue());
}
origin: stackoverflow.com

 public class RestrictedSample {

 private Sample sample = new Sample();

 public void method1(){ sample.method1(); }

 public void method2(){ sample.method2(); }

 public void method3(){ sample.method3(); }
}
origin: stackoverflow.com

 public Sample add(int number){
  Sample sample = new Sample();
  sample.setNumber(sample.number + number);
  return sample;
}
origin: stackoverflow.com

 final Sample a = new Sample();
SwingUtilities.invokeLater(new Runnable() {
  @Override
  public void run() {
    a.setVisible(true);
  }
});
this.dispose();
origin: OpenNMS/newts

private Sample getRate(Sample sample) {
  ValueType<?> value = NAN;
  Sample previous = m_prevSamples.get(sample.getName());
  if (previous != null) {
    long elapsed = sample.getTimestamp().asSeconds() - previous.getTimestamp().asSeconds();
    try {
      value = new Gauge(sample.getValue().delta(previous.getValue()).doubleValue() / elapsed);
    } catch (ArithmeticException e) {
      value = NAN;
    }
  }
  return new Sample(sample.getTimestamp(), sample.getResource(), sample.getName(), GAUGE, value, sample.getAttributes());
}
origin: OpenNMS/newts

int ttl = m_ttl;
if (calculateTimeToLive) {
  ttl -= (int) (now.asSeconds() - m.getTimestamp().asSeconds());
  if (ttl <= 0) {
    LOG.debug("Skipping expired sample: {}", m);
Duration resourceShard = m_contextConfigurations.getResourceShard(m.getContext());
    .value(SchemaConstants.F_CONTEXT, m.getContext().getId())
    .value(SchemaConstants.F_PARTITION, m.getTimestamp().stepFloor(resourceShard).asSeconds())
    .value(SchemaConstants.F_RESOURCE, m.getResource().getId())
    .value(SchemaConstants.F_COLLECTED, m.getTimestamp().asMillis())
    .value(SchemaConstants.F_METRIC_NAME, m.getName())
    .value(SchemaConstants.F_VALUE, ValueType.decompose(m.getValue()));
if (m.getAttributes() != null) {
  insert.value(SchemaConstants.F_ATTRIBUTES, m.getAttributes());
insert.setConsistencyLevel(m_contextConfigurations.getWriteConsistency(m.getContext()));
origin: stackoverflow.com

 Sample sample = new Sample();

  /*call the setter from Sample class and pass value
  to its parameter*/
  sample.setName("Andrew");

  /*
  access the name "Andrew" by calling getter
  */
  System.out.println("Welcome " + sample.getName());
}
origin: org.opennms.newts/newts-cassandra-search

maybeIndexResource(cacheQueue, generators, sample.getContext(), sample.getResource());
maybeIndexResourceAttributes(cacheQueue, generators, sample.getContext(), sample.getResource());
maybeAddMetricName(cacheQueue, generators, sample.getContext(), sample.getResource(), sample.getName());
origin: stackoverflow.com

 public void initialize() {
  Sample startEntity = new Sample();
  startEntity.setId(1);
  startEntity.setName("Start name");
  sampleRepository.saveSample(startEntity);
  sampleRepository.flush(); // <-- just to make sure scenario is recreated
  sampleRepository.clear(); // same as above
  LOGGER.info(sampleRepository.findSampleById(1));
  sampleRepository.clear(); // same as above above :D
}
origin: stackoverflow.com

public static void main(String args[])
 {
   Sample first = new Sample();
   first.setData(1);
   //Either
   //Sample second = new Sample();
   //second.setData(1);
   //or 
   Sample second = first;
   System.out.println(first.getData());  // 1
   System.out.println(second.getData()); // here, you will get 1 after above changes made.
 }
origin: stackoverflow.com

 Sample sam = new Sample();
interf intObj = new Sample();
Sample2 sam2 = new Sample2();

sam.intmethod();
sam.sampleMethod();
intObj.intmethod();
// the las one will give you an erro because sampleMethod is not defined for interf
//intObj.sampleMethod()
sam.intmethod();
sam2.sampleMethod2();
origin: stackoverflow.com

 Sample s = new Sample("first", "second");
Map<String, String> m = Collections.singletonMap(s.getFirst(), s.getSecond());
origin: stackoverflow.com

 public class SampleGSONParserAdapter implements
    JsonDeserializer<Sample> {

  @Override
  public Sample deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {

    Sample sample = new Sample();
    JsonObject sampleJsonObject = json.getAsJsonObject();

    sample.setName(sampleJsonObject.get("name").getAsString());

    // do the other parsing stuff here..

    // getting the data object as a string
    sample.setJsonString(sampleJsonObject.get("data").toString());

    return sample;
  }

}
origin: stackoverflow.com

 Sample sample = new Sample();
sample.setName("bar");
sample = sampleRepository.save(sample);
sampleSearchRepository.save(sample);
origin: stackoverflow.com

 Sample sam = new Sample();
 sam.setUsername("Test");
 JSONObject json = new JSONObject();  
 json.put("sample", sam.getUserName());
StringEntity se = new StringEntity(json.toString());  
 Httppostrequest.setEntity(se);
origin: stackoverflow.com

 Sample s = new Sample();

// Why this doesn't work?
for (String string : s.getStringList()) {

}
origin: stackoverflow.com

 class MySample {
  private Sample sample;
  //maybe other stuff

  public MySample(){ 
    sample = new Sample();
  }

  void one(){
    return sample.one();
  }
}
origin: stackoverflow.com

Sample objectOne = new Sample(1,2);
objectOne.print();
Sample objectTwo = new Sample(3,4);
objectOne.print();
origin: stackoverflow.com

 Sample sample=new Sample();
sample.method4();
passToUser((ISample)sample);
org.opennms.newts.apiSample

Most used methods

  • <init>
  • getName
  • getResource
  • getTimestamp
  • getValue
  • getContext
  • getType
  • getAttributes
  • compareSample
  • display
  • getData
  • getFirst
  • getData,
  • getFirst,
  • getId,
  • getLabel,
  • getMatrix,
  • getSecond,
  • getStringList,
  • getUserName,
  • intmethod,
  • isALive

Popular in Java

  • Parsing JSON documents to java classes using gson
  • scheduleAtFixedRate (Timer)
  • onRequestPermissionsResult (Fragment)
  • getResourceAsStream (ClassLoader)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • 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