类 WellFormedUtils

java.lang.Object
cn.herodotus.stirrup.core.foundation.utils.WellFormedUtils

public class WellFormedUtils extends Object

Description: 符合语法规则的工具类

主要包含增强代码健壮性和目前将无法形成工具箱的、不方便归类的工具方法,统一放在该类中。待某一类方法比较多了之后,再行拆分。

作者:
: gengwei.zheng
Date:
: 2023/5/23 16:55
  • 字段详细资料

    • MAP_TYPE_REFERENCE

      public static final org.springframework.core.ParameterizedTypeReference<Map<String,Object>> MAP_TYPE_REFERENCE
  • 构造器详细资料

    • WellFormedUtils

      public WellFormedUtils()
  • 方法详细资料

    • url

      public static String url(String url)
      符合语法规则的 URL

      检测地址相关字符串是否以"/"结尾,如果没有就帮助增加一个 ""/""

      参数:
      url - http 请求地址字符串
      返回:
      结构合理的请求地址字符串
    • parentId

      public static String parentId(String parentId)
      符合语法规则的 ParentId

      树形结构 ParentId 健壮性校验方法。

      参数:
      parentId - 父节点ID
      返回:
      格式友好的 parentId
    • addressToUri

      public static String addressToUri(String address, Protocol protocol, boolean endWithForwardSlash)
      将IP地址加端口号,转换为http地址。
      参数:
      address - ip地址加端口号,格式:ip:port
      protocol - http协议类型 Protocol
      endWithForwardSlash - 是否在结尾添加“/”
      返回:
      http格式地址
    • addressToUri

      public static String addressToUri(String address, boolean endWithForwardSlash)
      将IP地址加端口号,转换为http地址。
      参数:
      address - ip地址加端口号,格式:ip:port
      endWithForwardSlash - 是否在结尾添加“/”
      返回:
      http格式地址
    • addressToUri

      public static String addressToUri(String address)
      将IP地址加端口号,转换为http地址。
      参数:
      address - ip地址加端口号,格式:ip:port
      返回:
      http格式地址
    • getHostAddress

      public static String getHostAddress()
      获取运行主机ip地址
      返回:
      ip地址,或者null
    • serviceUri

      public static String serviceUri(String serviceUri, String serviceName, String gatewayServiceUri, String abbreviation)
    • sasUri

      public static String sasUri(String uri, String endpoint, String issuerUri)