org.springframework.util.Assert.endsWithSeparator()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(138)

本文整理了Java中org.springframework.util.Assert.endsWithSeparator()方法的一些代码示例,展示了Assert.endsWithSeparator()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assert.endsWithSeparator()方法的具体详情如下:
包路径:org.springframework.util.Assert
类名称:Assert
方法名:endsWithSeparator

Assert.endsWithSeparator介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-framework

private static void assignableCheckFailed(Class<?> superType, @Nullable Class<?> subType, @Nullable String msg) {
  String result = "";
  boolean defaultMessage = true;
  if (StringUtils.hasLength(msg)) {
    if (endsWithSeparator(msg)) {
      result = msg + " ";
    }
    else {
      result = messageWithTypeName(msg, subType);
      defaultMessage = false;
    }
  }
  if (defaultMessage) {
    result = result + (subType + " is not assignable to " + superType);
  }
  throw new IllegalArgumentException(result);
}

代码示例来源:origin: spring-projects/spring-framework

private static void instanceCheckFailed(Class<?> type, @Nullable Object obj, @Nullable String msg) {
  String className = (obj != null ? obj.getClass().getName() : "null");
  String result = "";
  boolean defaultMessage = true;
  if (StringUtils.hasLength(msg)) {
    if (endsWithSeparator(msg)) {
      result = msg + " ";
    }
    else {
      result = messageWithTypeName(msg, className);
      defaultMessage = false;
    }
  }
  if (defaultMessage) {
    result = result + ("Object of class [" + className + "] must be an instance of " + type);
  }
  throw new IllegalArgumentException(result);
}

代码示例来源:origin: org.springframework/spring-core

private static void assignableCheckFailed(Class<?> superType, @Nullable Class<?> subType, @Nullable String msg) {
  String result = "";
  boolean defaultMessage = true;
  if (StringUtils.hasLength(msg)) {
    if (endsWithSeparator(msg)) {
      result = msg + " ";
    }
    else {
      result = messageWithTypeName(msg, subType);
      defaultMessage = false;
    }
  }
  if (defaultMessage) {
    result = result + (subType + " is not assignable to " + superType);
  }
  throw new IllegalArgumentException(result);
}

代码示例来源:origin: org.springframework/spring-core

private static void instanceCheckFailed(Class<?> type, @Nullable Object obj, @Nullable String msg) {
  String className = (obj != null ? obj.getClass().getName() : "null");
  String result = "";
  boolean defaultMessage = true;
  if (StringUtils.hasLength(msg)) {
    if (endsWithSeparator(msg)) {
      result = msg + " ";
    }
    else {
      result = messageWithTypeName(msg, className);
      defaultMessage = false;
    }
  }
  if (defaultMessage) {
    result = result + ("Object of class [" + className + "] must be an instance of " + type);
  }
  throw new IllegalArgumentException(result);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-core

private static void assignableCheckFailed(Class<?> superType, @Nullable Class<?> subType, @Nullable String msg) {
  String result = "";
  boolean defaultMessage = true;
  if (StringUtils.hasLength(msg)) {
    if (endsWithSeparator(msg)) {
      result = msg + " ";
    }
    else {
      result = messageWithTypeName(msg, subType);
      defaultMessage = false;
    }
  }
  if (defaultMessage) {
    result = result + (subType + " is not assignable to " + superType);
  }
  throw new IllegalArgumentException(result);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-core

private static void instanceCheckFailed(Class<?> type, @Nullable Object obj, @Nullable String msg) {
  String className = (obj != null ? obj.getClass().getName() : "null");
  String result = "";
  boolean defaultMessage = true;
  if (StringUtils.hasLength(msg)) {
    if (endsWithSeparator(msg)) {
      result = msg + " ";
    }
    else {
      result = messageWithTypeName(msg, className);
      defaultMessage = false;
    }
  }
  if (defaultMessage) {
    result = result + ("Object of class [" + className + "] must be an instance of " + type);
  }
  throw new IllegalArgumentException(result);
}

相关文章