java.lang.Object
org.miaixz.bus.http.metric.anget.UserAgent
Represents a User-Agent, providing information about the browser, engine, OS, and device.
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
UserAgent
public UserAgent()Default constructor. -
UserAgent
Constructs a newUserAgentinstance.- Parameters:
name- The name of the component.regex- The regex pattern for matching.
-
UserAgent
Constructs a newUserAgentinstance.- Parameters:
name- The name of the component.pattern- The regex pattern for matching.
-
-
Method Details
-
parse
Parses a User-Agent string and returns aUserAgentobject.- Parameters:
text- The User-Agent string.- Returns:
- A
UserAgentobject, or null if the input is blank.
-
isMatch
Returns whether the given content contains a match for this component.- Parameters:
content- The User-Agent string.- Returns:
trueif a match is found,falseotherwise.
-
isUnknown
public boolean isUnknown()Returns whether this component is unknown.- Returns:
trueif this component is unknown,falseotherwise.
-
hashCode
public int hashCode() -
equals
-
toString
-