-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make public API setters fluent (#294)
- Loading branch information
1 parent
dea72f3
commit f2a89b3
Showing
15 changed files
with
421 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
apm-agent-api/src/main/java/co/elastic/apm/api/AbstractSpanImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
package co.elastic.apm.api; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
public abstract class AbstractSpanImpl implements Span { | ||
@Nonnull | ||
// co.elastic.apm.impl.transaction.AbstractSpan | ||
protected final Object span; | ||
|
||
AbstractSpanImpl(@Nonnull Object span) { | ||
this.span = span; | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public Span createSpan() { | ||
Object span = doCreateSpan(); | ||
return span != null ? new SpanImpl(span) : NoopSpan.INSTANCE; | ||
} | ||
|
||
private Object doCreateSpan() { | ||
// co.elastic.apm.agent.plugin.api.AbstractSpanInstrumentation$DoCreateSpanInstrumentation.doCreateSpan | ||
return null; | ||
} | ||
|
||
void doSetName(String name) { | ||
// co.elastic.apm.agent.plugin.api.AbstractSpanInstrumentation$SetNameInstrumentation.doSetName | ||
} | ||
|
||
void doSetType(String type) { | ||
// co.elastic.apm.agent.plugin.api.AbstractSpanInstrumentation$SetTypeInstrumentation.doSetType | ||
} | ||
|
||
void doAddTag(String key, String value) { | ||
// co.elastic.apm.agent.plugin.api.AbstractSpanInstrumentation$AddTagInstrumentation.doAddTag | ||
} | ||
|
||
@Override | ||
public void end() { | ||
// co.elastic.apm.agent.plugin.api.AbstractSpanInstrumentation$EndInstrumentation.end | ||
} | ||
|
||
@Override | ||
public void captureException(Throwable throwable) { | ||
// co.elastic.apm.agent.plugin.api.AbstractSpanInstrumentation.CaptureExceptionInstrumentation | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public String getId() { | ||
// co.elastic.apm.agent.plugin.api.AbstractSpanInstrumentation.GetIdInstrumentation | ||
return ""; | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public String getTraceId() { | ||
// co.elastic.apm.agent.plugin.api.AbstractSpanInstrumentation.GetTraceIdInstrumentation | ||
return ""; | ||
} | ||
|
||
@Override | ||
public Scope activate() { | ||
// co.elastic.apm.agent.plugin.api.AbstractSpanInstrumentation.ActivateInstrumentation | ||
return new ScopeImpl(span); | ||
} | ||
|
||
@Override | ||
public boolean isSampled() { | ||
// co.elastic.apm.agent.plugin.api.AbstractSpanInstrumentation.IsSampledInstrumentation | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.