@ProviderType public class OptimizationResult extends Object
Constructor and Description |
---|
OptimizationResult(org.apache.sling.api.resource.Resource resource) |
Modifier and Type | Method and Description |
---|---|
String |
getAlgorithm()
Returns the algorithm by which the file was optimized
|
byte[] |
getOptimizedContents()
Returns the raw optimized contents as a byte array
|
InputStream |
getOptimizedContentStream()
Returns the optimized contents as an InputStream
|
long |
getOptimizedSize()
Returns the optimized size in bytes
|
long |
getOriginalSize()
Return the original size in bytes
|
org.apache.sling.api.resource.Resource |
getResource()
Returns the resource that was optimized
|
double |
getSavings()
Return the percent savings as a 1-based double value
|
boolean |
isOptimized()
Returns true if the result is actually optimized, if the optimization did not
provide a smaller result or the file was not optimized for any other reason,
this will be false.
|
void |
setAlgorithm(String algorithm) |
void |
setOptimized(boolean optimized) |
void |
setOptimizedContents(byte[] optimizedContents) |
void |
setOptimizedSize(long optimizedSize) |
void |
setOriginalSize(long originalSize) |
void |
setSavings(double savings) |
public OptimizationResult(org.apache.sling.api.resource.Resource resource)
public String getAlgorithm()
public byte[] getOptimizedContents()
public InputStream getOptimizedContentStream()
public long getOptimizedSize()
public long getOriginalSize()
public org.apache.sling.api.resource.Resource getResource()
public double getSavings()
public boolean isOptimized()
public void setAlgorithm(String algorithm)
algorithm
- the algorithm to setpublic void setOptimized(boolean optimized)
optimized
- the optimized to setpublic void setOptimizedContents(byte[] optimizedContents)
public void setOptimizedSize(long optimizedSize)
optimizedSize
- the optimizedSize to setpublic void setOriginalSize(long originalSize)
originalSize
- the originalSize to setpublic void setSavings(double savings)
savings
- the savings to setCopyright © 2007–2018 The Apache Software Foundation. All rights reserved.