package org.simpleframework.xml.stream; import org.simpleframework.xml.util.Cache; import org.simpleframework.xml.util.ConcurrentCache; /* loaded from: classes6.dex */ class Builder implements Style { private final Cache attributes = new ConcurrentCache(); private final Cache elements = new ConcurrentCache(); private final Style style; public Builder(Style style) { this.style = style; } @Override // org.simpleframework.xml.stream.Style public String getAttribute(String str) { String fetch = this.attributes.fetch(str); if (fetch != null) { return fetch; } String attribute = this.style.getAttribute(str); if (attribute != null) { this.attributes.cache(str, attribute); } return attribute; } @Override // org.simpleframework.xml.stream.Style public String getElement(String str) { String fetch = this.elements.fetch(str); if (fetch != null) { return fetch; } String element = this.style.getElement(str); if (element != null) { this.elements.cache(str, element); } return element; } public void setAttribute(String str, String str2) { this.attributes.cache(str, str2); } public void setElement(String str, String str2) { this.elements.cache(str, str2); } }