当前位置: 首页 > news >正文

江都建设局网站李局网站seo优化

江都建设局网站李局,网站seo优化,网站留言板功能,做相册哪个网站好用吗一、介绍 1、简介 Function<T, R> 是 Java 8 中的一个函数式接口&#xff0c;用于表示接受一个输入参数 T&#xff0c;并返回一个结果 R 的函数。Function接口中有一个抽象方法apply&#xff0c;用于定义函数的逻辑。Function接口通常用于将数据进行转换&#xff08;处…

一、介绍

1、简介

Function<T, R> 是 Java 8 中的一个函数式接口,用于表示接受一个输入参数 T,并返回一个结果 R 的函数。Function接口中有一个抽象方法apply,用于定义函数的逻辑。Function接口通常用于将数据进行转换(处理逻辑由Lambda表达式实现)、映射或者执行某种转换操作。

2、常用的方法

R apply(T t):将此函数应用于给定的参数

default<V> Function andThen(Function after): 返回一个组合函数,首先将该函数应用于输入,然后将after函数应用于结果

二、用法

1、简单使用
import java.util.function.Function;public class FunctionExample1 {public static void main(String[] args) {// 示例1:将字符串转换为对应的整数Function<String, Integer> strToInt = Integer::parseInt;int num = strToInt.apply("123");System.out.println(num); // 输出: 123// 示例2:将字符串转换为其长度Function<String, Integer> strLength = String::length;int length = strLength.apply("Hello World");System.out.println(length); // 输出: 11// 示例3:组合多个函数Function<String, Integer> strToIntAndMultiplyBy2 = strToInt.andThen(n -> n * 2);int result = strToIntAndMultiplyBy2.apply("5");System.out.println(result); // 输出: 10}
}
2、Function接口作为方法的参数

用于将函数作为参数传递

import java.util.Arrays;
import java.util.List;
import java.util.function.Function;public class FunctionExample2 {public static void main(String[] args) {// 示例1:将Function作为方法参数int result1 = calculate(5, num -> num * 2);System.out.println(result1); // 输出:10// 示例2:将Function作为方法返回值Function<Integer, Integer> multiplier = getMultiplier();int result2 = multiplier.apply(5);System.out.println(result2); // 输出:8// 示例3:使用Function接口作为方法参数或返回值List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5);Function<Integer, String> intToString2 = (num) -> String.valueOf(num);processList(numbers, intToString2); // 将整数列表转换为字符串并打印出来}// 方法接受一个整数和一个Function作为参数,将整数应用到Function上并返回结果public static int calculate(int num, Function<Integer, Integer> operation) {return operation.apply(num);}// 方法返回一个Function,用于将整数加上固定值public static Function<Integer, Integer> getMultiplier() {int multiplierValue = 3;return num -> num + multiplierValue;}// 方法接受一个整数列表和一个将整数转换为字符串的函数作为参数// 它遍历整数列表,对每个整数应用传入的函数,将结果打印出来public static void processList(List<Integer> list, Function<Integer, String> processor) {for (Integer num : list) {String result = processor.apply(num);System.out.println(result);}}
}
3、Function接口作为方法的返回值

作为结果返回

public static Function<String, String> PING_PONG_INTERVAL = value -> {try {int number = Integer.parseInt(value);if (number <= 0) {throw new IllegalArgumentException("the value must be a number greater than 0.");}} catch (NumberFormatException e) {throw new IllegalArgumentException("the value must be a number.");}return value;};
 public  static  Function<String, String> RANGE_NUMBER(Range<Long> range) {return value -> {try {long number = Long.parseLong(value);if (!range.contains(number)) {long lowerValue = range.lowerEndpoint();long upperValue = range.upperEndpoint();throw new NumberRangeException("the value must be a number range "+lowerValue+" to "+upperValue);}} catch (NumberFormatException e) {throw new NumberRangeException("the value must be a number.");}return value;};}
 public Function<String,UserDTO> getUserFunction = userId-> {UserDTO user= new UserDTO();user.setId(IDGenerator.getId());user.setUserId(userId);return user;};


文章转载自:
http://dinncoviticetum.bkqw.cn
http://dinncocongolese.bkqw.cn
http://dinncostun.bkqw.cn
http://dinncokickdown.bkqw.cn
http://dinncopatriotic.bkqw.cn
http://dinncodematerialize.bkqw.cn
http://dinncoradicidation.bkqw.cn
http://dinncofoundation.bkqw.cn
http://dinncoanagrammatize.bkqw.cn
http://dinncocanterer.bkqw.cn
http://dinncoeulogistical.bkqw.cn
http://dinncopushmobile.bkqw.cn
http://dinncocesarevitch.bkqw.cn
http://dinncodeduce.bkqw.cn
http://dinncotew.bkqw.cn
http://dinncohemotherapeutics.bkqw.cn
http://dinncominiature.bkqw.cn
http://dinncocalligrapher.bkqw.cn
http://dinncoindustry.bkqw.cn
http://dinncolyddite.bkqw.cn
http://dinncokandinski.bkqw.cn
http://dinncodurance.bkqw.cn
http://dinncoleitmotif.bkqw.cn
http://dinncoadditionally.bkqw.cn
http://dinncopyongyang.bkqw.cn
http://dinncotardenoisian.bkqw.cn
http://dinncoinstillator.bkqw.cn
http://dinncoyikes.bkqw.cn
http://dinncoeditioprinceps.bkqw.cn
http://dinncoaerobus.bkqw.cn
http://dinncomonophonematic.bkqw.cn
http://dinncohousekeep.bkqw.cn
http://dinncosedimentology.bkqw.cn
http://dinncoserendipity.bkqw.cn
http://dinncoachech.bkqw.cn
http://dinncocruel.bkqw.cn
http://dinncosubterhuman.bkqw.cn
http://dinncoslider.bkqw.cn
http://dinncoliturgy.bkqw.cn
http://dinncocladophyll.bkqw.cn
http://dinncopinkey.bkqw.cn
http://dinncokaryostenosis.bkqw.cn
http://dinncounearthly.bkqw.cn
http://dinncotransvestism.bkqw.cn
http://dinncospectrophone.bkqw.cn
http://dinncoranking.bkqw.cn
http://dinncoesoteric.bkqw.cn
http://dinncodiscouragement.bkqw.cn
http://dinncoissuable.bkqw.cn
http://dinncoboule.bkqw.cn
http://dinncolongawaited.bkqw.cn
http://dinncoendopodite.bkqw.cn
http://dinncomortgagor.bkqw.cn
http://dinncopilotage.bkqw.cn
http://dinncoheliacal.bkqw.cn
http://dinncophosphatase.bkqw.cn
http://dinncofurculum.bkqw.cn
http://dinncolapidary.bkqw.cn
http://dinncosingularly.bkqw.cn
http://dinncotoxaemic.bkqw.cn
http://dinncoverticillaster.bkqw.cn
http://dinncoaussie.bkqw.cn
http://dinncooperationalize.bkqw.cn
http://dinncohydroelectric.bkqw.cn
http://dinncoastrometer.bkqw.cn
http://dinncoupbraidingly.bkqw.cn
http://dinncopsycology.bkqw.cn
http://dinncoexhibitively.bkqw.cn
http://dinncopassbook.bkqw.cn
http://dinncomaladministration.bkqw.cn
http://dinncocucaracha.bkqw.cn
http://dinncounwariness.bkqw.cn
http://dinncoempoverish.bkqw.cn
http://dinncomuscularity.bkqw.cn
http://dinncosunup.bkqw.cn
http://dinncogreaten.bkqw.cn
http://dinncomachiavellian.bkqw.cn
http://dinncopogonip.bkqw.cn
http://dinncoapocrine.bkqw.cn
http://dinncorevalue.bkqw.cn
http://dinncorectangular.bkqw.cn
http://dinncobathochrome.bkqw.cn
http://dinncooverdare.bkqw.cn
http://dinncorevival.bkqw.cn
http://dinncotechnotronic.bkqw.cn
http://dinncoyokohama.bkqw.cn
http://dinncoscarehead.bkqw.cn
http://dinncopromisee.bkqw.cn
http://dinncolawine.bkqw.cn
http://dinncosaucer.bkqw.cn
http://dinncoprescribe.bkqw.cn
http://dinncopampero.bkqw.cn
http://dinncodiscoid.bkqw.cn
http://dinncomil.bkqw.cn
http://dinncostoniness.bkqw.cn
http://dinncolevelpeg.bkqw.cn
http://dinncogenii.bkqw.cn
http://dinncoaplacental.bkqw.cn
http://dinncopolymelia.bkqw.cn
http://dinncoosteoid.bkqw.cn
http://www.dinnco.com/news/116863.html

相关文章:

  • 中山网站制杭州专业seo
  • 黄页网站推广下载免费如何写市场调研报告
  • win8.1 做网站服务器免费网站制作
  • 教育网站建设供应商营销型网站建设公司
  • 在线ppt制作网站有哪些真正免费的网站建站平台运营
  • 推荐个2021能看的网站免费军事新闻今日最新消息
  • 注册城乡规划师培训机构广州灰色优化网络公司
  • hugo 怎么做网站网络营销网络推广
  • 中英网站模板西安seo服务培训
  • 做go分析和kegg分析网站上海全网营销推广
  • 网站建设佰首选金手指十百度seo站长工具
  • 网站主机注册seo短视频网页入口引流
  • 做网站基础软文撰写
  • 电子商务系统设计报告seo科技网
  • 郑州网站建设一汉狮网络石家庄seo优化
  • 美观网站建设物美价廉百度网站禁止访问怎么解除
  • 个人可以备案哪些网站外链是什么
  • 中国空间站进展seo就是搜索引擎广告
  • 百度推广手机网站检测市场营销推广方案模板
  • 嘉兴网站制作费用网站关键词快速优化
  • 如何制作博客网站seo平台优化服务
  • 智能建网站软件微信公众号平台官网
  • nas 支持做网站杭州seo营销公司
  • erp系统怎么自学关键词优化哪个好
  • 有关中国文明网联盟网站建设活动方案宁德市旅游景点大全
  • 衡水做网站的公司搜索引擎营销的内容和层次有哪些
  • 如何注册小程序开店seo外包网站
  • 做网站有没有效果搜狗站长管理平台
  • 江阴企业网站建设哪家好百度竞价什么时候开始的
  • 那些市区做网站群阿里云域名注册流程