Skip to content

Commit

Permalink
Pull request updates: private constructor, move singleton method, for…
Browse files Browse the repository at this point in the history
…mat files, remove tuple
  • Loading branch information
Konrad Dysput committed Nov 12, 2024
1 parent 8f58ea5 commit 1e1660b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ public class ApplicationMetadataCache {
*/
private String packageName;

private final Context context;

private ApplicationMetadataCache(Context context) {
this.context = context;
}

/**
* Returns current application cache. This instance is a singleton since we can only operate
* in a single application scope.
Expand All @@ -45,12 +51,6 @@ public static ApplicationMetadataCache getInstance(Context context) {
return instance;
}

private final Context context;

public ApplicationMetadataCache(Context context) {
this.context = context;
}

/**
* Retrieves application name from context. The name will be cached over checks
*
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package backtraceio.library.models.attributes;

import java.util.HashMap;
import java.util.Map;

public class ReportDataAttributes {
private final HashMap<String, String> reportAttributes = new HashMap<>();
private final Map<String, String> reportAttributes = new HashMap<>();

private final HashMap<String, Object> reportAnnotations = new HashMap<>();
private final Map<String, Object> reportAnnotations = new HashMap<>();


public void addAnnotation(String key, Object value) {
Expand All @@ -16,12 +17,11 @@ public void addAttribute(String key, String value) {
reportAttributes.put(key, value);
}

public HashMap<String, String> getAttributes() {
public Map<String, String> getAttributes() {
return reportAttributes;
}

public HashMap<String, Object> getAnnotations() {
public Map<String, Object> getAnnotations() {
return reportAnnotations;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ public static ReportDataAttributes getReportAttributes(Map<String, Object> attri
/**
* Divide custom user attributes into primitive and complex attributes and add to this object
*
* @param attributes client's attributes
* @param skipNull define attributes behavior on null value. By default all null values
* will be included in the report. For some features like metrics, we don't want to send
* null values, because they can generate invalid behavior/incorrect information.
* @param attributes client's attributes
* @param skipNull define attributes behavior on null value. By default all null values
* will be included in the report. For some features like metrics, we don't want to send
* null values, because they can generate invalid behavior/incorrect information.
* @return Report data attributes divided into attributes and annotations
*/
public static ReportDataAttributes getReportAttributes(Map<String, Object> attributes, boolean skipNull) {
Expand All @@ -49,6 +49,5 @@ public static ReportDataAttributes getReportAttributes(Map<String, Object> attri
}

return reportDataAttributes;

}
}

0 comments on commit 1e1660b

Please sign in to comment.